diff options
| author | bors <bors@rust-lang.org> | 2021-02-13 13:47:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-13 13:47:02 +0000 |
| commit | 7e0241c63755ea28045d512b742f50b307874419 (patch) | |
| tree | cf4fe6673c765ba8ebca80c0152d10494e3b50f1 /src/tools | |
| parent | 3158857297417566824631a85c4cb3c0615ec6c2 (diff) | |
| parent | f87afe54b87586a80b9a2b8e0193c933ef763e6d (diff) | |
Auto merge of #81666 - hyd-dev:miri-windows-test-fail, r=Mark-Simulacrum
Don't release Miri if its tests only failed on Windows Extends #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
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/build-manifest/src/main.rs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 73a4cbd0792..d7c2fb8c8b8 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -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; + } } } |
