3 # Copyright 2017 The Rust Project Developers. See the COPYRIGHT
4 # file at the top-level directory of this distribution and at
5 # http://rust-lang.org/COPYRIGHT.
7 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10 # option. This file may not be copied, modified, or distributed
11 # except according to those terms.
16 TOOLSTATE_FILE="$(realpath $2)"
18 COMMIT="$(git rev-parse HEAD)"
19 CHANGED_FILES="$(git diff --name-status HEAD HEAD^)"
21 touch "$TOOLSTATE_FILE"
24 python2.7 "$X_PY" test --no-fail-fast \
33 # If this PR is intended to update one of these tools, do not let the build pass
34 # when they do not test-pass.
35 for TOOL in rls rustfmt clippy; do
36 echo "Verifying status of $TOOL..."
37 if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]src/tools/$TOOL$"; then
38 echo "This PR updated 'src/tools/$TOOL', verifying if status is 'test-pass'..."
39 if grep -vq '"'"$TOOL"'[^"]*":"test-pass"' "$TOOLSTATE_FILE"; then
41 echo "⚠️ We detected that this PR updated '$TOOL', but its tests failed."
43 echo "If you do intend to update '$TOOL', please check the error messages above and"
44 echo "commit another update."
46 echo "If you do NOT intend to update '$TOOL', please ensure you did not accidentally"
47 echo "change the submodule at 'src/tools/$TOOL'. You may ask your reviewer for the"
54 if [ "$RUST_RELEASE_CHANNEL" = nightly -a -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_set}" ]; then
55 . "$(dirname $0)/repo.sh"
56 MESSAGE_FILE=$(mktemp -t msg.XXXXXX)
57 echo "($OS CI update)" > "$MESSAGE_FILE"
58 commit_toolstate_change "$MESSAGE_FILE" \
60 $COMMIT\t$(cat "$TOOLSTATE_FILE")
66 if grep -q fail "$TOOLSTATE_FILE"; then