Skip to content

Make the Rust test suite portable to macOS (printf, timeout, temp-dir paths) - #1747

Merged
thekevinscott merged 10 commits into
mainfrom
bot/1574-macos-test-portability-1117
Nov 20, 2026
Merged

thekevinscott merged 10 commits into
mainfrom
bot/1574-macos-test-portability-1117

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1574

Slice 1 of macOS support: test-portability fixes only. No production behavior changes.

  • Bare printf on-file hooks wrapped in sh -c (BSD printf fails on arguments its format does not consume).
  • timeout replaced with perl -e 'alarm shift; exec @ARGV' (macOS ships no timeout).
  • stat -c falls back to BSD stat -f.
  • FIFO fixtures made with libc::mkfifo (rustix has no FIFO API on macOS).
  • Watcher over_detects accepts the watched dir as supplied or canonicalized (macOS /var -> /private/var); Windows leg green.

macOS result

A temporary macOS tests job witnessed progress and is removed in this PR; it cannot be required until every macOS failure is fixed.

  • Baseline (run 44004779422): 34 failures.
  • After this slice (run 44346226640, job 134949234193): 21 failures across 8 test targets.

Left for later slices (each needs a maintainer ruling):

  • Non-UTF-8 file names rejected by APFS (11).
  • Watcher renames / directories or link targets moved out of the root (8).
  • glob_conformance fixture collides É/é on a case- and normalization-insensitive filesystem (1).
  • on_file trailing args: path as supplied vs canonical (1).
  • Intermittent: canonical path handed to callbacks in config_glob_parity; FSEvents replay double-running a startup hook.

E2E Verification

Test-only change under packages/rust/src (test modules), so both receipts:

  • Python: uv run python -m pytest tests/e2e/cli_version_test.py tests/e2e/on_file_query_test.py tests/e2e/on_file_failure_test.py -x -q -- pass.
  • TypeScript: pnpm test:e2e -- pass.

Manual exercise: the probe job ran the full Rust suite on macos-latest; failures dropped 34 -> 21, with no new Linux or Windows failures.

skip-changelog: CI-only, no package source changes
…n macOS

rustix has no mknodat or mkfifoat on Apple targets.

skip-changelog: test-only change, no observable behaviour
skip-changelog: test-only change, no observable behaviour
…Events paths)

BSD printf fails on arguments its format does not consume, so a bare printf hook is wrapped in sh -c. macOS ships no timeout(1); perl's alarm bounds the command instead. BSD stat spells the mtime format -f %m. FSEvents reports paths with symlinks resolved, so the watcher test compares against the canonical temp dir.

skip-changelog: test-only change, no observable behaviour
…ortability-1117

# Conflicts:
#	packages/rust/tests/scan_failures.rs
@thekevinbot
thekevinbot marked this pull request as ready for review November 19, 2026 02:55
@thekevinscott
thekevinscott merged commit d1b2c9f into main Nov 20, 2026
102 of 104 checks passed
@thekevinscott
thekevinscott deleted the bot/1574-macos-test-portability-1117 branch November 20, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants