Skip to content

fix: validate materialized immutable_inputs paths to survive macOS te…#23458

Open
thiago-carbonera wants to merge 1 commit into
pantsbuild:mainfrom
thiago-carbonera:fix/immutable-inputs-revalidation
Open

fix: validate materialized immutable_inputs paths to survive macOS te…#23458
thiago-carbonera wants to merge 1 commit into
pantsbuild:mainfrom
thiago-carbonera:fix/immutable-inputs-revalidation

Conversation

@thiago-carbonera

Copy link
Copy Markdown
Contributor

Fixes #23411

Problem

On macOS, a long-running pantsd instance can outlive the OS periodic temp cleaner (which reaps unaccessed files in $TMPDIR after ~3 days). ImmutableInputs::path_for_dir was memoizing paths in memory and returning them without verifying if the underlying directory still existed on disk, causing tools like Docker to fail with executable file not found in $PATH because their $PATH pointed to a deleted directory.

Solution

  • Updated path_for_dir to check path.exists() on the cached PathBuf.
  • If the path has been deleted, it invalidates the stale cache entry by replacing it with a new OnceCell and forces the directory to be re-materialized.
  • Added a regression test in local_tests.rs to simulate the exact OS reaper behavior.

@thiago-carbonera thiago-carbonera force-pushed the fix/immutable-inputs-revalidation branch 2 times, most recently from eb81417 to 7ae8cba Compare June 30, 2026 17:34
…mp reaper (pantsbuild#23411)

Signed-off-by: Thiago Riemma Carbonera <thiagoriemma@gmail.com>
@thiago-carbonera thiago-carbonera force-pushed the fix/immutable-inputs-revalidation branch from 7ae8cba to 495f847 Compare June 30, 2026 17:57
@thiago-carbonera

Copy link
Copy Markdown
Contributor Author

@benjyw Could you review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant