about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2024-03-13 11:18:41 -0400
committerBen Kimock <kimockb@gmail.com>2024-03-13 20:10:10 -0400
commit48a19ffd5e46bb93a030d62b009953900f37f350 (patch)
tree8178e77b3f0469a80649d18acef8d8e97381e37a /src
parentb6f4ff580f8acc67762f9e3bc29d75b812eed9d9 (diff)
downloadrust-48a19ffd5e46bb93a030d62b009953900f37f350.tar.gz
rust-48a19ffd5e46bb93a030d62b009953900f37f350.zip
Improve sysroots notification
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/.github/workflows/sysroots.yml21
-rwxr-xr-xsrc/tools/miri/ci/build-all-targets.sh7
2 files changed, 22 insertions, 6 deletions
diff --git a/src/tools/miri/.github/workflows/sysroots.yml b/src/tools/miri/.github/workflows/sysroots.yml
index 96d7d4d1118..60d9ef5bb37 100644
--- a/src/tools/miri/.github/workflows/sysroots.yml
+++ b/src/tools/miri/.github/workflows/sysroots.yml
@@ -21,6 +21,13 @@ jobs:
           ./miri install
           python3 -m pip install beautifulsoup4
           ./ci/build-all-targets.sh
+      - name: Upload build errors
+        # We don't want to skip this step on failure
+        if: always()
+        uses: actions/upload-artifact@v4
+        with:
+          name: failures
+          path: failures.tar.gz
 
   sysroots-cron-fail-notify:
     name: sysroots cronjob failure notification
@@ -28,6 +35,11 @@ jobs:
     needs: [sysroots]
     if: failure() || cancelled()
     steps:
+      # Download our build error logs
+      - name: Download build errors
+        uses: actions/download-artifact@v4
+        with:
+          name: failures
       # Send a Zulip notification
       - name: Install zulip-send
         run: pip3 install zulip
@@ -36,11 +48,12 @@ jobs:
           ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
           ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
         run: |
+          tar xf failures.tar.gz
+          ls failures
           ~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
-            --stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
-            --message 'Dear @*T-miri*,
-
-          It would appear that the [Miri sysroots cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
+            --stream miri --subject "Sysroot Build Errors (miri, $(date -u +%Y-%m))" \
+            --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:
+          $(ls failures)
 
           Would you mind investigating this issue?
 
diff --git a/src/tools/miri/ci/build-all-targets.sh b/src/tools/miri/ci/build-all-targets.sh
index fdb645c3ae1..b93d4f5eec4 100755
--- a/src/tools/miri/ci/build-all-targets.sh
+++ b/src/tools/miri/ci/build-all-targets.sh
@@ -3,6 +3,7 @@
 set -eu
 set -o pipefail
 
+# .github/workflows/sysroots.yml relies on this name this to report which sysroots didn't build
 FAILS_DIR=failures
 
 rm -rf $FAILS_DIR
@@ -13,14 +14,16 @@ PLATFORM_SUPPORT_FILE=$(rustc +miri --print sysroot)/share/doc/rust/html/rustc/p
 for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do
     # Wipe the cache before every build to minimize disk usage
     cargo +miri miri clean
-    if cargo +miri miri setup --target $target 2>&1 | tee failures/$target; then
+    if cargo +miri miri setup --target $target 2>&1 | tee $FAILS_DIR/$target; then
         # If the build succeeds, delete its output. If we have output, a build failed.
         rm $FAILS_DIR/$target
     fi
 done
 
+tar czf $FAILS_DIR.tar.gz $FAILS_DIR
+
 # If the sysroot for any target fails to build, we will have a file in FAILS_DIR.
-if [[ $(ls failures | wc -l) -ne 0 ]]; then
+if [[ $(ls $FAILS_DIR | wc -l) -ne 0 ]]; then
     echo "Sysroots for the following targets failed to build:"
     ls $FAILS_DIR
     exit 1