From 8ed16fe47a421781752272f4bd1e11eb5d3c9839 Mon Sep 17 00:00:00 2001 From: kennytm Date: Sat, 30 Dec 2017 00:05:15 +0800 Subject: [PATCH 1/2] Requires tools to test-pass if the corresponding submodule is updated. If a PR intends to update a tool but its test has failed, abort the merge regardless of current channel. This should help the tool maintainers if the update turns out to be failing due to changes in latest master. --- .travis.yml | 2 +- appveyor.yml | 2 +- src/ci/docker/x86_64-gnu-tools/checktools.sh | 24 +++++++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a7725e01cf0f..d955c3ac3c397 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ services: - docker git: - depth: 1 + depth: 2 submodules: false matrix: diff --git a/appveyor.yml b/appveyor.yml index da7885540491d..1a186c080ce0d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -96,7 +96,7 @@ environment: matrix: fast_finish: true -clone_depth: 1 +clone_depth: 2 build: false install: diff --git a/src/ci/docker/x86_64-gnu-tools/checktools.sh b/src/ci/docker/x86_64-gnu-tools/checktools.sh index 0d40863c0920f..b9268fe62ed06 100755 --- a/src/ci/docker/x86_64-gnu-tools/checktools.sh +++ b/src/ci/docker/x86_64-gnu-tools/checktools.sh @@ -16,6 +16,7 @@ X_PY="$1" TOOLSTATE_FILE="$(realpath $2)" OS="$3" COMMIT="$(git rev-parse HEAD)" +CHANGED_FILES="$(git diff --name-status HEAD HEAD^)" touch "$TOOLSTATE_FILE" @@ -29,7 +30,28 @@ set -e cat "$TOOLSTATE_FILE" -if [ "$RUST_RELEASE_CHANNEL" = nightly ]; then +# If this PR is intended to update one of these tools, do not let the build pass +# when they do not test-pass. +for TOOL in rls rustfmt miri clippy; do + echo "Verifying status of $TOOL..." + if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]src/tools/$TOOL$"; then + echo "This PR updated 'src/tools/$TOOL', verifying if status is 'test-pass'..." + if grep -vq '"'"$TOOL"'[^"]*":"test-pass"' "$TOOLSTATE_FILE"; then + echo + echo "⚠️ We detected that this PR updated '$TOOL', but its tests failed." + echo + echo "If you do intend to update '$TOOL', please check the error messages above and" + echo "commit another update." + echo + echo "If you do NOT intend to update '$TOOL', please ensure you did not accidentally" + echo "change the submodule at 'src/tools/$TOOL'. You may ask your reviewer for the" + echo "proper steps." + exit 3 + fi + fi +done + +if [ "$RUST_RELEASE_CHANNEL" = nightly -a -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_set}" ]; then . "$(dirname $0)/repo.sh" MESSAGE_FILE=$(mktemp -t msg.XXXXXX) echo "($OS CI update)" > "$MESSAGE_FILE" From 05953b3d600021eb158719d0394593640302ff86 Mon Sep 17 00:00:00 2001 From: kennytm Date: Sat, 30 Dec 2017 00:06:20 +0800 Subject: [PATCH 2/2] (wip) --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d955c3ac3c397..e94daa9624f9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,13 +16,13 @@ matrix: if: type = pull_request OR branch = auto - env: IMAGE=dist-x86_64-linux DEPLOY=1 - if: branch = try OR branch = auto + if: branch = tryx OR branch = auto # "alternate" deployments, these are "nightlies" but have LLVM assertions # turned on, they're deployed to a different location primarily for # additional testing. - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1 - if: branch = try OR branch = auto + if: branch = tryx OR branch = auto - env: > RUST_CHECK_TARGET=dist @@ -169,7 +169,7 @@ matrix: - env: IMAGE=x86_64-gnu-aux if: branch = auto - env: IMAGE=x86_64-gnu-tools - if: branch = auto + # if: branch = auto - env: IMAGE=x86_64-gnu-debug if: branch = auto - env: IMAGE=x86_64-gnu-nopt