c-2003-workaround-qemu-vfork-command-not-found
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Thu, 13 Jun 2024 09:16:38 +0000 (11:16 +0200)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Thu, 24 Apr 2025 15:47:57 +0000 (17:47 +0200)
===================================================================

Gbp-Pq: Topic cargo
Gbp-Pq: Name c-2003-workaround-qemu-vfork-command-not-found.patch

src/tools/cargo/crates/cargo-test-macro/src/lib.rs

index f9740873184a562fde1d7edaf0f03e29ff60d800..b45e8c396a8f2b5b4353edab41923295929a9c5b 100644 (file)
@@ -291,6 +291,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\