Skip to content

Commit 6fc409e

Browse files
committed
Auto merge of rust-lang#50573 - oli-obk:tool_sanity, r=kennytm
Don't require clippy/miri for beta r? @kennytm cc @alexcrichton I'm trying this out locally atm to see if it works as I think it should. Not sure how to test it for real except wait for the next beta. fixes rust-lang#50557
2 parents 844bc65 + b817403 commit 6fc409e

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

src/ci/docker/x86_64-gnu-tools/checktools.sh

+33-11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ SIX_WEEK_CYCLE="$(( ($(date +%s) / 604800 - 3) % 6 ))"
2323

2424
touch "$TOOLSTATE_FILE"
2525

26+
# Try to test all the tools and store the build/test success in the TOOLSTATE_FILE
27+
2628
set +e
2729
python2.7 "$X_PY" test --no-fail-fast \
2830
src/doc/book \
@@ -38,6 +40,7 @@ set -e
3840
cat "$TOOLSTATE_FILE"
3941
echo
4042

43+
# This function checks that if a tool's submodule changed, the tool's state must improve
4144
verify_status() {
4245
echo "Verifying status of $1..."
4346
if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]$2$"; then
@@ -57,17 +60,36 @@ verify_status() {
5760
fi
5861
}
5962

63+
# deduplicates the submodule check and the assertion that on beta some tools MUST be passing
64+
check_dispatch() {
65+
if [ "$1" = submodule_changed ]; then
66+
# ignore $2 (branch id)
67+
verify_status $3 $4
68+
elif [ "$2" = beta ]; then
69+
echo "Requiring test passing for $3..."
70+
if grep -q '"'"$3"'":"\(test\|build\)-fail"' "$TOOLSTATE_FILE"; then
71+
exit 4
72+
fi
73+
fi
74+
}
75+
76+
# list all tools here
77+
status_check() {
78+
check_dispatch $1 beta book src/doc/book
79+
check_dispatch $1 beta nomicon src/doc/nomicon
80+
check_dispatch $1 beta reference src/doc/reference
81+
check_dispatch $1 beta rust-by-example src/doc/rust-by-example
82+
check_dispatch $1 beta rls src/tool/rls
83+
check_dispatch $1 beta rustfmt src/tool/rustfmt
84+
# these tools are not required for beta to successfully branch
85+
check_dispatch $1 nightly clippy-driver src/tool/clippy
86+
check_dispatch $1 nightly miri src/tool/miri
87+
}
88+
6089
# If this PR is intended to update one of these tools, do not let the build pass
6190
# when they do not test-pass.
6291

63-
verify_status book src/doc/book
64-
verify_status nomicon src/doc/nomicon
65-
verify_status reference src/doc/reference
66-
verify_status rust-by-example src/doc/rust-by-example
67-
verify_status rls src/tool/rls
68-
verify_status rustfmt src/tool/rustfmt
69-
verify_status clippy-driver src/tool/clippy
70-
verify_status miri src/tool/miri
92+
status_check "submodule_changed"
7193

7294
if [ "$RUST_RELEASE_CHANNEL" = nightly -a -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_set}" ]; then
7395
. "$(dirname $0)/repo.sh"
@@ -86,6 +108,6 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE")
86108
exit 0
87109
fi
88110

89-
if grep -q fail "$TOOLSTATE_FILE"; then
90-
exit 4
91-
fi
111+
# abort compilation if an important tool doesn't build
112+
# (this code is reachable if not on the nightly channel)
113+
status_check "beta_required"

0 commit comments

Comments
 (0)