Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't release Miri if its tests only failed on Windows #81666

Merged
merged 2 commits into from Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ jobs:
env:
SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json"
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
os: windows-latest-xl
- name: i686-mingw-1
env:
Expand Down
1 change: 1 addition & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ jobs:
env:
SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
<<: *job-windows-xl

# 32/64-bit MinGW builds.
Expand Down
30 changes: 16 additions & 14 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,24 +254,26 @@ impl Builder {
t!(self.checksums.store_cache());
}

/// If a tool does not pass its tests, don't ship it.
/// If a tool does not pass its tests on *any* of Linux and Windows, don't ship
/// it on *all* targets, because tools like Miri can "cross-run" programs for
/// different targets, for example, run a program for `x86_64-pc-windows-msvc`
/// on `x86_64-unknown-linux-gnu`.
/// Right now, we do this only for Miri.
fn check_toolstate(&mut self) {
let toolstates: Option<HashMap<String, String>> =
File::open(self.input.join("toolstates-linux.json"))
for file in &["toolstates-linux.json", "toolstates-windows.json"] {
let toolstates: Option<HashMap<String, String>> = File::open(self.input.join(file))
.ok()
.and_then(|f| serde_json::from_reader(&f).ok());
let toolstates = toolstates.unwrap_or_else(|| {
println!(
"WARNING: `toolstates-linux.json` missing/malformed; \
assuming all tools failed"
);
HashMap::default() // Use empty map if anything went wrong.
});
// Mark some tools as missing based on toolstate.
if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") {
println!("Miri tests are not passing, removing component");
self.versions.disable_version(&PkgType::Miri);
let toolstates = toolstates.unwrap_or_else(|| {
println!("WARNING: `{}` missing/malformed; assuming all tools failed", file);
HashMap::default() // Use empty map if anything went wrong.
});
// Mark some tools as missing based on toolstate.
RalfJung marked this conversation as resolved.
Show resolved Hide resolved
if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") {
println!("Miri tests are not passing, removing component");
self.versions.disable_version(&PkgType::Miri);
break;
}
}
}

Expand Down