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

This commit is contained in:
hyd-dev 2021-02-03 00:33:42 +08:00
parent a3ed564c13
commit f82315a37e
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
3 changed files with 14 additions and 13 deletions

View File

@ -349,6 +349,7 @@ jobs:
env: env:
SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows 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" 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 os: windows-latest-xl
- name: i686-mingw-1 - name: i686-mingw-1
env: env:

View File

@ -531,6 +531,7 @@ jobs:
env: env:
SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows 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 RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
<<: *job-windows-xl <<: *job-windows-xl
# 32/64-bit MinGW builds. # 32/64-bit MinGW builds.

View File

@ -257,21 +257,20 @@ impl Builder {
/// If a tool does not pass its tests, don't ship it. /// If a tool does not pass its tests, don't ship it.
/// Right now, we do this only for Miri. /// Right now, we do this only for Miri.
fn check_toolstate(&mut self) { fn check_toolstate(&mut self) {
let toolstates: Option<HashMap<String, String>> = for file in &["toolstates-linux.json", "toolstates-windows.json"] {
File::open(self.input.join("toolstates-linux.json")) let toolstates: Option<HashMap<String, String>> = File::open(self.input.join(file))
.ok() .ok()
.and_then(|f| serde_json::from_reader(&f).ok()); .and_then(|f| serde_json::from_reader(&f).ok());
let toolstates = toolstates.unwrap_or_else(|| { let toolstates = toolstates.unwrap_or_else(|| {
println!( println!("WARNING: `{}` missing/malformed; assuming all tools failed", file);
"WARNING: `toolstates-linux.json` missing/malformed; \ HashMap::default() // Use empty map if anything went wrong.
assuming all tools failed" });
); // Mark some tools as missing based on toolstate.
HashMap::default() // Use empty map if anything went wrong. if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") {
}); println!("Miri tests are not passing, removing component");
// Mark some tools as missing based on toolstate. self.versions.disable_version(&PkgType::Miri);
if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") { break;
println!("Miri tests are not passing, removing component"); }
self.versions.disable_version(&PkgType::Miri);
} }
} }