Skip to content

Commit

Permalink
Rollup merge of rust-lang#81666 - hyd-dev:miri-windows-test-fail, r=M…
Browse files Browse the repository at this point in the history
…ark-Simulacrum

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

Extends rust-lang#66053 to Windows, so the released Miri won't be broken if its tests only fail on Windows.

Relevant Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Miri.20is.20still.20available.20in.20rustup.20today.3F
  • Loading branch information
Dylan-DPC authored Feb 12, 2021
2 parents a1b0549 + f87afe5 commit abafbf3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
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.
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

0 comments on commit abafbf3

Please sign in to comment.