c-2003-workaround-qemu-vfork-command-not-found
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Wed, 12 Jun 2024 15:33:10 +0000 (17:33 +0200)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Wed, 12 Jun 2024 15:33:10 +0000 (17:33 +0200)
===================================================================

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

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

index 937fbce6be50cec90f4134849afa3b54c9d77550..01e956d8f5b3cc0b8ecb1db9ee79661590452cf2 100644 (file)
@@ -221,6 +221,14 @@ fn has_command(command: &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 `{}` to be runnable, got error {}:\n\
             stderr:{}\n\