]> git.proxmox.com Git - cargo.git/commitdiff
Patch test macro to work around qemu vfork bug when command not found
authorBlair Noctis <n@sail.ng>
Wed, 26 Oct 2022 07:23:32 +0000 (07:23 +0000)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 5 Dec 2022 15:16:58 +0000 (16:16 +0100)
debian/patches/2003-workaround-qemu-vfork-command-not-found.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/2003-workaround-qemu-vfork-command-not-found.patch b/debian/patches/2003-workaround-qemu-vfork-command-not-found.patch
new file mode 100644 (file)
index 0000000..553be81
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/crates/cargo-test-macro/src/lib.rs
++++ b/crates/cargo-test-macro/src/lib.rs
+@@ -203,6 +203,14 @@
+         }
+     };
+     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\
index cc97491335443647a4a93058b778ce1a62a3f811..a33919244518142fa7022bd45ca4df5e40275561 100644 (file)
@@ -1,4 +1,5 @@
 2002_disable-net-tests.patch
+2003-workaround-qemu-vfork-command-not-found.patch
 
 2200-workaround-x32-test.patch
 disable-fs-specific-test.patch