From: Debian Rust Maintainers Date: Thu, 13 Jun 2024 09:16:38 +0000 (+0200) Subject: c-2003-workaround-qemu-vfork-command-not-found X-Git-Tag: archive/raspbian/1.81.0+dfsg1-2+rpi1~1^2~44 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c91ccd48a0b25250a5527e77d0fa96be79d3b442;p=rustc.git c-2003-workaround-qemu-vfork-command-not-found =================================================================== Gbp-Pq: Topic cargo Gbp-Pq: Name c-2003-workaround-qemu-vfork-command-not-found.patch --- diff --git a/src/tools/cargo/crates/cargo-test-macro/src/lib.rs b/src/tools/cargo/crates/cargo-test-macro/src/lib.rs index 9d4a5fbaa9..c7df1865ea 100644 --- a/src/tools/cargo/crates/cargo-test-macro/src/lib.rs +++ b/src/tools/cargo/crates/cargo-test-macro/src/lib.rs @@ -240,6 +240,14 @@ fn check_command(command_path: &Path, args: &[&str]) -> bool { } }; if !output.status.success() { + // Debian specific patch, upstream wontfix: + // qemu has a faulty vfork where it fails to fail if a command is not + // found, with a unix_wait_status of 32512, or 0x7f00, 7f meaning + // exit code 127. See https://github.com/rust-lang/rust/issues/90825 + use std::os::unix::process::ExitStatusExt; + if output.status.into_raw() == 0x7f00 { + return false; + } panic!( "expected command `{command_name}` to be runnable, got error {}:\n\ stderr:{}\n\