Skip to content

Expose directories implied by remote inputs - #30926

Open
tamird wants to merge 1 commit into
bazelbuild:masterfrom
tamird:tamird/resolve-remote-input-paths
Open

tamird wants to merge 1 commit into
bazelbuild:masterfrom
tamird:tamird/resolve-remote-input-paths

Conversation

@tamird

@tamird tamird commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

With minimal downloads, input metadata can outlive its local parent directories. A later build can also leave a regular file at a parent path: cache reuse still supplies valid remote metadata, but canonicalization rejects the input before template expansion or executable-symlink actions can use it. Expose directories implied by checked inputs in the action filesystem, including directory listings and virtual permissions, so these consumers can reach the same inputs as spawn actions. Materialization repairs disk when bytes are needed; output-directory preparation repairs the host path before populating the action filesystem's overlay.

The directory index is built lazily and refreshed between discovery and execution. Physical symlinks continue to redirect traversal, so inferred directory nodes are revalidated while retaining their cached children. Inputs with traversable physical parents, physical directory lookups, and checks of declared output files with existing parents avoid the index. An ambiguous physical-file lookup must establish whether declared descendants exist; with 250,000 inputs, this first lookup takes roughly 5–6 ms and allocates 5.9 MB on macOS arm64. Warm local-file fast-digest lookups remain below 1 µs in the included benchmark.

Fixes #26877.

— Codex, on behalf of @tamird.

RELNOTES: None

@tamird
tamird requested a review from a team as a code owner August 29, 2026 17:23
@github-actions github-actions Bot added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Aug 29, 2026
@tamird

tamird commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@tjgq, this is an alternative to #30316. It handles missing input parents during filesystem path resolution, leaving SymlinkAction's executable checks unchanged and avoiding physical input-directory creation.

Updated for the latest revision: this PR is stacked on #31313, which depends on #31311. The first two commits carry those prerequisites; the fix here is 14de419. The base is master because the prerequisite branches live in a fork. Once the prerequisites merge, this branch can be rebased so the PR contains only this fix.

Update (2026-09-29): #30926 now contains one commit, 11d1eb4, directly on master. #31311 has merged. The revised fix supersedes #31313 by exposing the input’s implied parents and repairing stale physical paths when materializing contents or preparing outputs.

— Codex, on behalf of @tamird.

@bazel-docs-pr-commenter

bazel-docs-pr-commenter Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

✅ Bazel docs preview is ready!

Updated pages

Preview URL: https://bazel-pr-30926.mintlify.app/

Updated for 11d1eb4e15219b15df22b0f0aefd3ca004eb10de

@tamird
tamird force-pushed the tamird/resolve-remote-input-paths branch 2 times, most recently from 85c65d3 to b675261 Compare September 10, 2026 18:02
@tamird tamird changed the title Resolve remote input paths with missing parents Resolve remote inputs without parent metadata Sep 10, 2026
@tamird
tamird force-pushed the tamird/resolve-remote-input-paths branch from b675261 to 43a9038 Compare September 10, 2026 18:43
@tamird
tamird force-pushed the tamird/resolve-remote-input-paths branch 2 times, most recently from a9bc8af to 14de419 Compare September 24, 2026 22:22
Remote input metadata remains valid when its local parents are absent or
replaced by stale files, but canonicalization then hides the input from
in-process actions. Infer parent directories from checked inputs and use
that namespace for traversal, listing, and virtual permissions,
refreshing it after input discovery. Preserve physical symlink
traversal, and repair host output directories before updating the action
filesystem so output preparation also handles stale parents.
@tamird
tamird force-pushed the tamird/resolve-remote-input-paths branch from 14de419 to 11d1eb4 Compare September 29, 2026 17:30
@tamird tamird changed the title Resolve remote inputs without parent metadata Expose directories implied by remote inputs Sep 29, 2026

This branch has not been deployed

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

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symlink failure if bazel-bin cleaned between bazel runs, RBE enabled

1 participant