Use short_path for cache dir#163
Merged
Merged
Conversation
Bazel 8 flipped `--legacy_external_runfiles` to false by default, so files from external repositories no longer appear under `external/...` in a test's runfiles tree. Use `caches[0].root.short_path` instead, which yields a runfiles-relative path that is correct under both legacy and Bazel 8 layouts. Also replace the deprecated `ctx.genfiles_dir` alias with `ctx.bin_dir` in `_pkl_eval_impl`; both have produced the same value since `genfiles` was merged into `bindir` in Bazel 6.
KushalP
approved these changes
May 20, 2026
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.
Bazel 8 flipped
--legacy_external_runfilesto false by default, so files from external repositories no longer appear underexternal/...in a test's runfiles tree.Use
caches[0].root.short_pathinstead, which yields a runfiles-relative path that is correct under both legacy and Bazel 8 layouts.Also replace the deprecated
ctx.genfiles_diralias withctx.bin_dirin_pkl_eval_impl; both have produced the same value sincegenfileswas merged intobindirin Bazel 6.This also updates all
.bazelversionfiles to use8.7.0by default. We still run integration tests with both, Bazel v7 and v8.