Skip to content

Commit cb10a73

Browse files
committed
Check if tier 2 targets build in the nightly cron job
1 parent 842933c commit cb10a73

File tree

6 files changed

+95
-4
lines changed

6 files changed

+95
-4
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
cargo -V
7474
7575
- name: Test
76-
run: ./ci.sh
76+
run: ./ci/ci.sh
7777

7878
style:
7979
name: style checks
@@ -169,7 +169,7 @@ jobs:
169169
--message 'Dear @*T-miri*,
170170
171171
It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.
172-
172+
173173
This likely means that rustc changed the miri directory and
174174
we now need to do a [`./miri rustc-pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
175175

.github/workflows/sysroots.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Tier 2 sysroots
2+
3+
on: push
4+
# schedule:
5+
# - cron: '44 4 * * *' # At 4:44 UTC every day.
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
sysroots:
13+
name: Build the sysroots
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Build the sysroots
18+
run: |
19+
cargo install -f rustup-toolchain-install-master
20+
./miri toolchain -c rust-docs # Docs are the only place targets are separated by tier
21+
./miri install
22+
python3 -m pip install beautifulsoup4
23+
./ci/build-all-targets.sh
24+
25+
sysroots-cron-fail-notify:
26+
name: sysroots cronjob failure notification
27+
runs-on: ubuntu-latest
28+
needs: [sysroots]
29+
if: failure() || cancelled()
30+
steps:
31+
# Send a Zulip notification
32+
- name: Install zulip-send
33+
run: pip3 install zulip
34+
- name: Send Zulip notification
35+
env:
36+
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
37+
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
38+
run: |
39+
~/.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.
44+
45+
Would you mind investigating this issue?
46+
47+
Thanks in advance!
48+
Sincerely,
49+
The Miri Cronjobs Bot'

cargo-miri/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/build-all-targets.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
set -o pipefail
5+
6+
FAILS_DIR=failures
7+
8+
rm -rf $FAILS_DIR
9+
mkdir $FAILS_DIR
10+
11+
PLATFORM_SUPPORT_FILE=$(rustc +miri --print sysroot)/share/doc/rust/html/rustc/platform-support.html
12+
13+
for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do
14+
# Wipe the cache before every build to minimize disk usage
15+
rm -rf ~/.cache/miri
16+
if cargo +miri miri setup --target $target 2>&1 | tee failures/$target; then
17+
# If the build succeeds, delete its output. If we have output, a build failed.
18+
rm $FAILS_DIR/$target
19+
fi
20+
done
21+
22+
# 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
24+
echo "Sysroots for the following targets failed to build:"
25+
ls $FAILS_DIR
26+
exit 1
27+
fi

ci.sh renamed to ci/ci.sh

File renamed without changes.

ci/scrape-targets.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
from bs4 import BeautifulSoup
3+
4+
html = open(sys.argv[1], 'r').read()
5+
soup = BeautifulSoup(html, features="html.parser")
6+
# The tables are:
7+
# Tier 1 <-- this is already checked by main CI, so we ignore it here
8+
# Tier 2 with host tools <-- we want this one
9+
# Tier 2 without host tools <-- and also this
10+
# Tier 3
11+
for table in soup.find_all("table")[1:3]:
12+
for row in table.find_all('tr'):
13+
code = row.find('code')
14+
if code is not None:
15+
print(code.text)

0 commit comments

Comments
 (0)