Skip to content

Read repository labels without materializing unrelated files - #31803

Closed
dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:codex/bazel-pr123-upstream
Closed

dzbarsky wants to merge 1 commit into
bazelbuild:masterfrom
dzbarsky:codex/bazel-pr123-upstream

Conversation

@dzbarsky

Copy link
Copy Markdown
Contributor

Direct ctx.read(Label(...)) calls currently materialize an entire remote
repository to read one file. Resolve direct reads without materialization
and use the remote filesystem's existing per-file reads. ctx.path and
native-process inputs still materialize the repository.

In two cache restores, reading three files from a 50,000-file repository
took 7.4–7.7s instead of 32.2–41.5s. Contents and recorded input markers
matched. Includes a regression for lazy reads, changed inputs, recovery after
cache eviction and explicit ctx.path behavior.

Resolve direct ctx.read(Label(...)) inputs without materializing the
referenced remote repository. RemoteExternalOverlayFileSystem already
fetches the requested file. Keep ctx.path, execute inputs and label
watching unchanged.

In two matched cache restores, reading three files from a 50,000-file
repository took 32.2–41.5s before and 7.4–7.7s after. Neither variant
re-executed the producer; contents and recorded input markers matched.

Add a regression for lazy reads, input changes, cache eviction retries
and explicit ctx.path materialization.
@dzbarsky
dzbarsky requested a review from a team as a code owner October 15, 2026 22:58
@github-actions github-actions Bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Oct 15, 2026
@meisterT

Copy link
Copy Markdown
Member

Are the test failures related?

@dzbarsky

Copy link
Copy Markdown
Contributor Author

Fabian is 1-upping me in #31493

@dzbarsky dzbarsky closed this Oct 21, 2026
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Remote-Exec Issues and PRs for the Execution (Remote) team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants