Skip to content

Commit 44954ab

Browse files
committed
Clarify toolstate names. Move publish.py to a more convenient location.
1 parent d7488c3 commit 44954ab

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ matrix:
188188
script:
189189
MESSAGE_FILE=$(mktemp -t msg.XXXXXX);
190190
. src/ci/docker/x86_64-gnu-tools/repo.sh;
191-
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"
191+
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"
192192

193193
env:
194194
global:

src/bootstrap/check.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl Step for Rls {
256256
builder.add_rustc_lib_path(compiler, &mut cargo);
257257

258258
if try_run(build, &mut cargo) {
259-
build.save_toolstate("rls", ToolState::Testing);
259+
build.save_toolstate("rls", ToolState::TestPass);
260260
}
261261
}
262262
}
@@ -302,7 +302,7 @@ impl Step for Rustfmt {
302302
builder.add_rustc_lib_path(compiler, &mut cargo);
303303

304304
if try_run(build, &mut cargo) {
305-
build.save_toolstate("rustfmt", ToolState::Testing);
305+
build.save_toolstate("rustfmt", ToolState::TestPass);
306306
}
307307
}
308308
}
@@ -352,7 +352,7 @@ impl Step for Miri {
352352
builder.add_rustc_lib_path(compiler, &mut cargo);
353353

354354
if try_run(build, &mut cargo) {
355-
build.save_toolstate("miri", ToolState::Testing);
355+
build.save_toolstate("miri", ToolState::TestPass);
356356
}
357357
} else {
358358
eprintln!("failed to test miri: could not build");
@@ -407,7 +407,7 @@ impl Step for Clippy {
407407
builder.add_rustc_lib_path(compiler, &mut cargo);
408408

409409
if try_run(build, &mut cargo) {
410-
build.save_toolstate("clippy-driver", ToolState::Testing);
410+
build.save_toolstate("clippy-driver", ToolState::TestPass);
411411
}
412412
} else {
413413
eprintln!("failed to test clippy: could not build");

src/bootstrap/tool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ impl Step for ToolBuild {
116116
let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path);
117117
let is_expected = build.try_run(&mut cargo);
118118
build.save_toolstate(tool, if is_expected {
119-
ToolState::Compiling
119+
ToolState::TestFail
120120
} else {
121-
ToolState::Broken
121+
ToolState::BuildFail
122122
});
123123

124124
if !is_expected {

src/bootstrap/toolstate.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
// except according to those terms.
1010

1111
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
12+
#[serde(rename_all = "kebab-case")]
1213
/// Whether a tool can be compiled, tested or neither
1314
pub enum ToolState {
1415
/// The tool compiles successfully, but the test suite fails
15-
Compiling = 1,
16+
TestFail = 1,
1617
/// The tool compiles successfully and its test suite passes
17-
Testing = 2,
18+
TestPass = 2,
1819
/// The tool can't even be compiled
19-
Broken = 0,
20+
BuildFail = 0,
2021
}
2122

2223
impl Default for ToolState {
2324
fn default() -> Self {
2425
// err on the safe side
25-
ToolState::Broken
26+
ToolState::BuildFail
2627
}
2728
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE")
4141
exit 0
4242
fi
4343

44-
if grep -q 'Broken\|Compiling' "$TOOLSTATE_FILE"; then
44+
if grep -q fail "$TOOLSTATE_FILE"; then
4545
exit 4
4646
fi

0 commit comments

Comments
 (0)