diff options
| author | kennytm <kennytm@gmail.com> | 2017-12-22 01:16:21 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2017-12-27 00:00:46 +0800 |
| commit | 44954ab52d82fe5ae5222c3bfd482d38c3db0baa (patch) | |
| tree | d9dee3177bf9a289fb87a7a43f33bcb9c9cea3ad | |
| parent | d7488c308963ddc98811cafc95f75cd1647baf0a (diff) | |
| download | rust-44954ab52d82fe5ae5222c3bfd482d38c3db0baa.tar.gz rust-44954ab52d82fe5ae5222c3bfd482d38c3db0baa.zip | |
Clarify toolstate names. Move publish.py to a more convenient location.
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | src/bootstrap/check.rs | 8 | ||||
| -rw-r--r-- | src/bootstrap/tool.rs | 4 | ||||
| -rw-r--r-- | src/bootstrap/toolstate.rs | 9 | ||||
| -rwxr-xr-x | src/ci/docker/x86_64-gnu-tools/checktools.sh | 2 | ||||
| -rwxr-xr-x | src/tools/publish_toolstate.py (renamed from src/ci/docker/x86_64-gnu-tools/publish.py) | 0 |
6 files changed, 13 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index 4a55aab5a41..74099b3014a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -188,7 +188,7 @@ matrix: script: MESSAGE_FILE=$(mktemp -t msg.XXXXXX); . src/ci/docker/x86_64-gnu-tools/repo.sh; - commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/ci/docker/x86_64-gnu-tools/publish.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" + commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" env: global: diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 79a6a39d546..714c01aa504 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -256,7 +256,7 @@ impl Step for Rls { builder.add_rustc_lib_path(compiler, &mut cargo); if try_run(build, &mut cargo) { - build.save_toolstate("rls", ToolState::Testing); + build.save_toolstate("rls", ToolState::TestPass); } } } @@ -302,7 +302,7 @@ impl Step for Rustfmt { builder.add_rustc_lib_path(compiler, &mut cargo); if try_run(build, &mut cargo) { - build.save_toolstate("rustfmt", ToolState::Testing); + build.save_toolstate("rustfmt", ToolState::TestPass); } } } @@ -352,7 +352,7 @@ impl Step for Miri { builder.add_rustc_lib_path(compiler, &mut cargo); if try_run(build, &mut cargo) { - build.save_toolstate("miri", ToolState::Testing); + build.save_toolstate("miri", ToolState::TestPass); } } else { eprintln!("failed to test miri: could not build"); @@ -407,7 +407,7 @@ impl Step for Clippy { builder.add_rustc_lib_path(compiler, &mut cargo); if try_run(build, &mut cargo) { - build.save_toolstate("clippy-driver", ToolState::Testing); + build.save_toolstate("clippy-driver", ToolState::TestPass); } } else { eprintln!("failed to test clippy: could not build"); diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 16e8b025b08..ea055cb5d1b 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -116,9 +116,9 @@ impl Step for ToolBuild { let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path); let is_expected = build.try_run(&mut cargo); build.save_toolstate(tool, if is_expected { - ToolState::Compiling + ToolState::TestFail } else { - ToolState::Broken + ToolState::BuildFail }); if !is_expected { diff --git a/src/bootstrap/toolstate.rs b/src/bootstrap/toolstate.rs index 3c490044e4e..f63c1988906 100644 --- a/src/bootstrap/toolstate.rs +++ b/src/bootstrap/toolstate.rs @@ -9,19 +9,20 @@ // except according to those terms. #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[serde(rename_all = "kebab-case")] /// Whether a tool can be compiled, tested or neither pub enum ToolState { /// The tool compiles successfully, but the test suite fails - Compiling = 1, + TestFail = 1, /// The tool compiles successfully and its test suite passes - Testing = 2, + TestPass = 2, /// The tool can't even be compiled - Broken = 0, + BuildFail = 0, } impl Default for ToolState { fn default() -> Self { // err on the safe side - ToolState::Broken + ToolState::BuildFail } } diff --git a/src/ci/docker/x86_64-gnu-tools/checktools.sh b/src/ci/docker/x86_64-gnu-tools/checktools.sh index e06b6ab3d1b..0d40863c092 100755 --- a/src/ci/docker/x86_64-gnu-tools/checktools.sh +++ b/src/ci/docker/x86_64-gnu-tools/checktools.sh @@ -41,6 +41,6 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE") exit 0 fi -if grep -q 'Broken\|Compiling' "$TOOLSTATE_FILE"; then +if grep -q fail "$TOOLSTATE_FILE"; then exit 4 fi diff --git a/src/ci/docker/x86_64-gnu-tools/publish.py b/src/tools/publish_toolstate.py index b90947e5a43..b90947e5a43 100755 --- a/src/ci/docker/x86_64-gnu-tools/publish.py +++ b/src/tools/publish_toolstate.py |
