Skip to content

Commit

Permalink
Rollup merge of rust-lang#50573 - oli-obk:tool_sanity, r=kennytm
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alexcrichton authored May 10, 2018
2 parents 6a1380c + b817403 commit 1eb617c
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions src/ci/docker/x86_64-gnu-tools/checktools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ SIX_WEEK_CYCLE="$(( ($(date +%s) / 604800 - 3) % 6 ))"

touch "$TOOLSTATE_FILE"

# Try to test all the tools and store the build/test success in the TOOLSTATE_FILE

set +e
python2.7 "$X_PY" test --no-fail-fast \
src/doc/book \
Expand All @@ -38,6 +40,7 @@ set -e
cat "$TOOLSTATE_FILE"
echo

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

# deduplicates the submodule check and the assertion that on beta some tools MUST be passing
check_dispatch() {
if [ "$1" = submodule_changed ]; then
# ignore $2 (branch id)
verify_status $3 $4
elif [ "$2" = beta ]; then
echo "Requiring test passing for $3..."
if grep -q '"'"$3"'":"\(test\|build\)-fail"' "$TOOLSTATE_FILE"; then
exit 4
fi
fi
}

# list all tools here
status_check() {
check_dispatch $1 beta book src/doc/book
check_dispatch $1 beta nomicon src/doc/nomicon
check_dispatch $1 beta reference src/doc/reference
check_dispatch $1 beta rust-by-example src/doc/rust-by-example
check_dispatch $1 beta rls src/tool/rls
check_dispatch $1 beta rustfmt src/tool/rustfmt
# these tools are not required for beta to successfully branch
check_dispatch $1 nightly clippy-driver src/tool/clippy
check_dispatch $1 nightly miri src/tool/miri
}

# If this PR is intended to update one of these tools, do not let the build pass
# when they do not test-pass.

verify_status book src/doc/book
verify_status nomicon src/doc/nomicon
verify_status reference src/doc/reference
verify_status rust-by-example src/doc/rust-by-example
verify_status rls src/tool/rls
verify_status rustfmt src/tool/rustfmt
verify_status clippy-driver src/tool/clippy
verify_status miri src/tool/miri
status_check "submodule_changed"

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

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

0 comments on commit 1eb617c

Please sign in to comment.