File: c-2003-workaround-qemu-vfork-command-not-found.patch

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (28 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Date: Thu, 13 Jun 2024 11:16:38 +0200
Subject: c-2003-workaround-qemu-vfork-command-not-found

===================================================================
---
 src/tools/cargo/crates/cargo-test-macro/src/lib.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

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 c3b82fe..dd8783d 100644
--- a/src/tools/cargo/crates/cargo-test-macro/src/lib.rs
+++ b/src/tools/cargo/crates/cargo-test-macro/src/lib.rs
@@ -289,6 +289,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\