Skip to content

Commit 7c39c77

Browse files
committed
Improve sysroots notification
1 parent b228407 commit 7c39c77

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/sysroots.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,25 @@ jobs:
2121
./miri install
2222
python3 -m pip install beautifulsoup4
2323
./ci/build-all-targets.sh
24+
- name: Upload build errors
25+
# We don't want to skip this step on failure
26+
if: always()
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: failures
30+
path: failures.tar.gz
2431

2532
sysroots-cron-fail-notify:
2633
name: sysroots cronjob failure notification
2734
runs-on: ubuntu-latest
2835
needs: [sysroots]
2936
if: failure() || cancelled()
3037
steps:
38+
# Download our build error logs
39+
- name: Download build errors
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: failures
3143
# Send a Zulip notification
3244
- name: Install zulip-send
3345
run: pip3 install zulip
@@ -36,11 +48,12 @@ jobs:
3648
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
3749
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
3850
run: |
51+
tar xf failures.tar.gz
52+
ls failures
3953
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
40-
--stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
41-
--message 'Dear @*T-miri*,
42-
43-
It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
54+
--stream miri --subject "Sysroot Build Errors (miri, $(date -u +%Y-%m))" \
55+
--message 'It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed to build these targets:
56+
$(ls failures)
4457
4558
Would you mind investigating this issue?
4659

ci/build-all-targets.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -eu
44
set -o pipefail
55

6+
# .github/workflows/sysroots.yml relies on this name this to report which sysroots didn't build
67
FAILS_DIR=failures
78

89
rm -rf $FAILS_DIR
@@ -13,14 +14,16 @@ PLATFORM_SUPPORT_FILE=$(rustc +miri --print sysroot)/share/doc/rust/html/rustc/p
1314
for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do
1415
# Wipe the cache before every build to minimize disk usage
1516
cargo +miri miri clean
16-
if cargo +miri miri setup --target $target 2>&1 | tee failures/$target; then
17+
if cargo +miri miri setup --target $target 2>&1 | tee $FAILS_DIR/$target; then
1718
# If the build succeeds, delete its output. If we have output, a build failed.
1819
rm $FAILS_DIR/$target
1920
fi
2021
done
2122

23+
tar czf $FAILS_DIR.tar.gz $FAILS_DIR
24+
2225
# If the sysroot for any target fails to build, we will have a file in FAILS_DIR.
23-
if [[ $(ls failures | wc -l) -ne 0 ]]; then
26+
if [[ $(ls $FAILS_DIR | wc -l) -ne 0 ]]; then
2427
echo "Sysroots for the following targets failed to build:"
2528
ls $FAILS_DIR
2629
exit 1

0 commit comments

Comments
 (0)