Repository navigation
test(link): use the system BSD stat in the Darwin trust fixture - #9030
Conversation
The macOS CI jobs put Homebrew coreutils' gnubin first on PATH, so
Bun.which("stat") returned GNU stat and the Darwin branch of the BSD stat
stub ran `stat -f <format>`, which GNU reads as --file-system. The gate then
saw no path info and fell back. Call /usr/bin/stat, always the BSD stat on
macOS, so the case keeps exercising real BSD output on any PATH.
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Maintainer integration into
|
Summary
The
devbatch gate (run 44878221019,deve97f8167e) is red on macOS: job "macos 3/4" failstests/clients/link-served-runtime-trust.test.ts› "BSD stat preserves sticky ancestors and zero-padded permission bits" withfallbackinstead ofserved. The suite came in with #8981.The product code is correct. The macOS CI jobs add Homebrew coreutils'
gnubinto the front ofPATH(ci.yml:echo "$(brew --prefix coreutils)/libexec/gnubin" >> "$GITHUB_PATH"), soBun.which("stat")is GNUstatthere. The test's Darwin stub then ran<GNU stat> -f '%u %Mp%03Lp' <path>. GNU reads-fas--file-systemand the format as a path, so it fails,served_path_inforeports nothing, and the gate correctly refuses the recorded runtime.The stub now calls
/usr/bin/staton Darwin, which is always the BSDstat, so the case exercises real BSD-foutput regardless ofPATH. The assertion is unchanged, and the Linux emulation branch is untouched.Verification
On macOS (mac-studio), Bun 1.4.4 runner,
bun scripts/test.ts tests/clients/link-served-runtime-trust.test.ts:origin/deve567fd1a4with/opt/homebrew/opt/coreutils/libexec/gnubinfirst onPATH(as in CI): 28 pass, 1 fail. The failure is the same test with the sameservedvsfallbackdiff as the CI job.PATH: 29 pass, 1 skip, 0 fail.PATH(/usr/bin/stat): 29 pass, 1 skip, 0 fail.bun run typecheck: no type errors.PR CI runs only on Ubuntu, where this branch is unchanged. The next
devbatch gate covers macOS.Checklist
Summary by CodeRabbit
statcommand on macOS and other platforms, improving cross-platform test compatibility.