Skip to content

Commit 7e0241c

Browse files
committed
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
2 parents 3158857 + f87afe5 commit 7e0241c

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

Diff for: .github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ jobs:
349349
env:
350350
SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
351351
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json"
352+
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
352353
os: windows-latest-xl
353354
- name: i686-mingw-1
354355
env:

Diff for: src/ci/github-actions/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ jobs:
531531
env:
532532
SCRIPT: src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh x.py /tmp/toolstate/toolstates.json windows
533533
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json
534+
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
534535
<<: *job-windows-xl
535536

536537
# 32/64-bit MinGW builds.

Diff for: src/tools/build-manifest/src/main.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -254,24 +254,26 @@ impl Builder {
254254
t!(self.checksums.store_cache());
255255
}
256256

257-
/// If a tool does not pass its tests, don't ship it.
257+
/// If a tool does not pass its tests on *any* of Linux and Windows, don't ship
258+
/// it on *all* targets, because tools like Miri can "cross-run" programs for
259+
/// different targets, for example, run a program for `x86_64-pc-windows-msvc`
260+
/// on `x86_64-unknown-linux-gnu`.
258261
/// Right now, we do this only for Miri.
259262
fn check_toolstate(&mut self) {
260-
let toolstates: Option<HashMap<String, String>> =
261-
File::open(self.input.join("toolstates-linux.json"))
263+
for file in &["toolstates-linux.json", "toolstates-windows.json"] {
264+
let toolstates: Option<HashMap<String, String>> = File::open(self.input.join(file))
262265
.ok()
263266
.and_then(|f| serde_json::from_reader(&f).ok());
264-
let toolstates = toolstates.unwrap_or_else(|| {
265-
println!(
266-
"WARNING: `toolstates-linux.json` missing/malformed; \
267-
assuming all tools failed"
268-
);
269-
HashMap::default() // Use empty map if anything went wrong.
270-
});
271-
// Mark some tools as missing based on toolstate.
272-
if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") {
273-
println!("Miri tests are not passing, removing component");
274-
self.versions.disable_version(&PkgType::Miri);
267+
let toolstates = toolstates.unwrap_or_else(|| {
268+
println!("WARNING: `{}` missing/malformed; assuming all tools failed", file);
269+
HashMap::default() // Use empty map if anything went wrong.
270+
});
271+
// Mark some tools as missing based on toolstate.
272+
if toolstates.get("miri").map(|s| &*s as &str) != Some("test-pass") {
273+
println!("Miri tests are not passing, removing component");
274+
self.versions.disable_version(&PkgType::Miri);
275+
break;
276+
}
275277
}
276278
}
277279

0 commit comments

Comments
 (0)