Skip to content

Check if tier 2 targets build in the nightly cron job #3260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
cargo -V

- name: Test
run: ./ci.sh
run: ./ci/ci.sh

style:
name: style checks
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
--message 'Dear @*T-miri*,

It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.

This likely means that rustc changed the miri directory and
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).

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/sysroots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tier 2 sysroots

on: push
# schedule:
# - cron: '44 4 * * *' # At 4:44 UTC every day.

defaults:
run:
shell: bash

jobs:
sysroots:
name: Build the sysroots
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the sysroots
run: |
cargo install -f rustup-toolchain-install-master
./miri toolchain -c rust-docs # Docs are the only place targets are separated by tier
./miri install
python3 -m pip install beautifulsoup4
./ci/build-all-targets.sh

sysroots-cron-fail-notify:
name: sysroots cronjob failure notification
runs-on: ubuntu-latest
needs: [sysroots]
if: failure() || cancelled()
steps:
# Send a Zulip notification
- name: Install zulip-send
run: pip3 install zulip
- name: Send Zulip notification
env:
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}
run: |
~/.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.

Would you mind investigating this issue?

Thanks in advance!
Sincerely,
The Miri Cronjobs Bot'
4 changes: 2 additions & 2 deletions cargo-miri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions ci/build-all-targets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -eu
set -o pipefail

FAILS_DIR=failures

rm -rf $FAILS_DIR
mkdir $FAILS_DIR

PLATFORM_SUPPORT_FILE=$(rustc +miri --print sysroot)/share/doc/rust/html/rustc/platform-support.html

for target in $(python3 ci/scrape-targets.py $PLATFORM_SUPPORT_FILE); do
# Wipe the cache before every build to minimize disk usage
rm -rf ~/.cache/miri
if cargo +miri miri setup --target $target 2>&1 | tee failures/$target; then
# If the build succeeds, delete its output. If we have output, a build failed.
rm $FAILS_DIR/$target
fi
done

# 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
echo "Sysroots for the following targets failed to build:"
ls $FAILS_DIR
exit 1
fi
File renamed without changes.
15 changes: 15 additions & 0 deletions ci/scrape-targets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys
from bs4 import BeautifulSoup

html = open(sys.argv[1], 'r').read()
soup = BeautifulSoup(html, features="html.parser")
# The tables are:
# Tier 1 <-- this is already checked by main CI, so we ignore it here
# Tier 2 with host tools <-- we want this one
# Tier 2 without host tools <-- and also this
# Tier 3
for table in soup.find_all("table")[1:3]:
for row in table.find_all('tr'):
code = row.find('code')
if code is not None:
print(code.text)