Skip to content

Commit d475e62

Browse files
committed
Auto merge of rust-lang#3260 - saethlin:build-all-tier-2, r=RalfJung
Check if tier 2 targets build in the nightly cron job This PR adds a CI job that only runs nightly which will install Miri built from the latest commit, and try to build every Tier 2 without host tools target, as documented on https://doc.rust-lang.org/nightly/rustc/platform-support.html. I'm not really excited about the idea of scraping the tier 2 without host tools list, but also keeping the list up-to-date by hand seems prone to forgetting to update it. And that update seems like the sort of manual maintenance we should automate.
2 parents 6f017d2 + 7d5de70 commit d475e62

File tree

6 files changed

+95
-4
lines changed

6 files changed

+95
-4
lines changed

src/tools/miri/.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
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'

src/tools/miri/cargo-miri/Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ dependencies = [
194194

195195
[[package]]
196196
name = "rustc-build-sysroot"
197-
version = "0.4.2"
197+
version = "0.4.4"
198198
source = "registry+https://github.com/rust-lang/crates.io-index"
199-
checksum = "8ed2a90dfa5232ed5ff21d53d4df655f315ab316ea06fc508f1c74bcedb1ce6c"
199+
checksum = "39dcf8d82b1f79a179bdb284dc44db440a9666eefa5a6df5ef282d6db930d544"
200200
dependencies = [
201201
"anyhow",
202202
"rustc_version",
+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
File renamed without changes.

src/tools/miri/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)