Skip to content

Commit

Permalink
Clarify toolstate names. Move publish.py to a more convenient location.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Dec 26, 2017
1 parent d7488c3 commit 44954ab
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions src/bootstrap/toolstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion src/ci/docker/x86_64-gnu-tools/checktools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.

0 comments on commit 44954ab

Please sign in to comment.