Repository navigation
[9.2.0] Materialize chains of symlinks in remote repos - #29959
Merged
Merged
Conversation
fmeum
force-pushed
the
cherry-materialize
branch
from
June 23, 2026 10:42
2de3000 to
9df34d6
Compare
When a remotely cached repo is partially materialized since it contains action inputs, Skyframe provides the metadata of these inputs after following all symlinks as it does for all source files. Since (chains of) symlinks need to be preserved and materialized in the same way as if the repo rule ran locally or was fully materialized as a dependency of another repo rule, `AbstractActionInputPrefetcher` is changed to walk the full chain of symlinks behind a prefetched external repo path replant every link verbatim on the host file system. This proves very difficult to get right for repos with symlinks pointing into the main repo as such symlinks would cross over into the host filesystem. For this reason such symlinks now exclude a repo from being cached remotely. Note that the local repo contents cache already doesn't cache such repos. Since main repo files are readily available, this is considered a minor loss in usefulness only. Fixes bazelbuild#29656 Fixes bazelbuild#29515 No - [x] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). RELNOTES: The remote repo contents cache now correctly materializes chains of symlinks as action inputs, but no longer supports symlinks into the main repository. Closes bazelbuild#29767. PiperOrigin-RevId: 936532134 Change-Id: I48b63f6fd2d5f57e139175e3ed578d65f6abbd08 (cherry picked from commit c310e3e)
fmeum
force-pushed
the
cherry-materialize
branch
from
June 23, 2026 12:28
9df34d6 to
3dad21f
Compare
Collaborator
Author
|
@coeuvre I fixed CI failures |
iancha1992
enabled auto-merge
June 23, 2026 17:12
coeuvre
approved these changes
Jun 24, 2026
iancha1992
added this pull request to the merge queue
Jun 24, 2026
Merged
via the queue into
bazelbuild:release-9.2.0
with commit Jun 24, 2026
4820bf6
45 checks passed
aherrmann
added a commit
to yume-ag/bviz
that referenced
this pull request
Sep 30, 2026
With --experimental_remote_repo_contents_cache, Bazel 9.0.1 caches only repositories whose marker file records nothing beyond the predeclared inputs hash; a repository that records further inputs while it is fetched is skipped, so it is refetched on every clean start. That covers the crate repositories that read the crates index, patched repositories, and http_archive with a build_file label. Bazel 9.1.0 extends the cache to all reproducible repository rules (bazelbuild/bazel#29225). Bazel 9.2.0 fixes symlink handling in the cache but excludes repositories with symlinks into the main repository or into other repositories (bazelbuild/bazel#29959, #30190), such as the llvm runtime source repositories and the ztracing crate; those are still fetched on every clean start. The lockfile moves to format version 28 and picks up rules_java 9.1.0 through bazel_tools.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a remotely cached repo is partially materialized since it contains action inputs, Skyframe provides the metadata of these inputs after following all symlinks as it does for all source files. Since (chains of) symlinks need to be preserved and materialized in the same way as if the repo rule ran locally or was fully materialized as a dependency of another repo rule,
AbstractActionInputPrefetcheris changed to walk the full chain of symlinks behind a prefetched external repo path replant every link verbatim on the host file system.This proves very difficult to get right for repos with symlinks pointing into the main repo as such symlinks would cross over into the host filesystem. For this reason such symlinks now exclude a repo from being cached remotely. Note that the local repo contents cache already doesn't cache such repos. Since main repo files are readily available, this is considered a minor loss in usefulness only.
Fixes #29656
Fixes #29515
RELNOTES: The remote repo contents cache now correctly materializes chains of symlinks as action inputs, but no longer supports symlinks into the main repository.
Closes #29767.
PiperOrigin-RevId: 936532134
Change-Id: I48b63f6fd2d5f57e139175e3ed578d65f6abbd08
(cherry picked from commit c310e3e)
Fixes #29816