From 5778e9f05d8ae81949452c632adbaa3637bfa42a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 15 Nov 2026 22:41:00 +0100 Subject: [PATCH 1/2] openbsd.yml: TEMPORARY probe of target/debug/deps around the uucore tests --- .github/workflows/openbsd.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml index d062ba43826..d7474a429d8 100644 --- a/.github/workflows/openbsd.yml +++ b/.github/workflows/openbsd.yml @@ -1,6 +1,6 @@ name: OpenBSD -# spell-checker:ignore sshfs usesh vmactions taiki esac fdescfs fdesc nextest copyback logind +# spell-checker:ignore sshfs usesh vmactions taiki esac fdescfs fdesc nextest copyback logind mlugg zigbuild liblibc rlib env: FEATURES: "feat_Tier1,feat_require_unix" @@ -153,9 +153,16 @@ jobs: cargo test --features ${{ env.FEATURES }} || FAULT=1 echo "::endgroup::" fi + # TEMPORARY diagnostic: find which phase removes files from target/debug/deps if (test -z "\$FAULT"); then echo "::group::cargo test (uucore)" - cargo test --all-features -p uucore || FAULT=1 + echo "[deps] after workspace: \$(ls target/debug/deps | wc -l) files; \$(ls -l target/debug/deps/liblibc-*.rlib 2>&1)" + cargo test --all-features -p uucore --no-run || FAULT=1 + echo "[deps] after uucore build: \$(ls target/debug/deps | wc -l) files; \$(ls -l target/debug/deps/liblibc-*.rlib 2>&1)" + cargo test --all-features -p uucore --lib || FAULT=1 + echo "[deps] after uucore unit tests: \$(ls target/debug/deps | wc -l) files; \$(ls -l target/debug/deps/liblibc-*.rlib 2>&1)" + cargo test --all-features -p uucore --doc || FAULT=1 + echo "[deps] after uucore doc tests: \$(ls target/debug/deps | wc -l) files; \$(ls -l target/debug/deps/liblibc-*.rlib 2>&1)" echo "::endgroup::" fi # Test building with make From 76d275dd265c2af90a522ae06ee3a79e3c4ff69d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 15 Nov 2026 23:17:00 +0100 Subject: [PATCH 2/2] tail: keep the --pid test processes off the test runner's stdin The dummy "sh" inherited stdin, so on OpenBSD CI, where the job script is piped into sh, it read and ran the rest of the script (uucore tests, make, cargo clean) concurrently, randomly deleting the doctests' rlibs. Use sleep with a null stdin, and plain seconds as BSD sleep rejects "999d". --- tests/by-util/test_tail.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index 13e430e9e38..e6235ec197a 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -927,8 +927,13 @@ fn test_follow_with_pid() { let (at, mut ucmd) = at_and_ucmd!(); - let dummy_cmd = "sh"; - let mut dummy = Command::new(dummy_cmd).spawn().unwrap(); + // A process that just waits; with stdin detached, so it can't read from + // whatever feeds the test runner (on CI, the rest of the job script). + let mut dummy = Command::new("sleep") + .arg("100000") + .stdin(Stdio::null()) + .spawn() + .unwrap(); let pid = dummy.id(); let mut child = ucmd @@ -5426,9 +5431,11 @@ fn test_following_with_pid() { let ts = TestScenario::new(util_name!()); + // Plain seconds: a "d" suffix is a GNU extension the BSD sleep rejects. #[cfg(not(windows))] let mut sleep_command = Command::new("sleep") - .arg("999d") + .arg("100000") + .stdin(Stdio::null()) .spawn() .expect("failed to start sleep command"); #[cfg(windows)]