summaryrefslogtreecommitdiffstats
path: root/debian/patches/2003-workaround-qemu-vfork-command-not-found.patch
blob: d7f6424a588cf68eb2ac4cd7824ea4dfdb77dee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Index: cargo/crates/cargo-test-macro/src/lib.rs
===================================================================
--- cargo.orig/crates/cargo-test-macro/src/lib.rs
+++ cargo/crates/cargo-test-macro/src/lib.rs
@@ -223,6 +223,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\