-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find runfiles in directories that are themselves runfiles #1
Conversation
@phst I submitted this PR to keep this runfiles library in sync with the Bazel-provided ones after a potential resolution of bazelbuild/bazel#14336. I have marked it as a draft just in case bazelbuild/bazel#14335 is not accepted. |
6791d7d
to
1e44425
Compare
@phst The corresponding Bazel PR bazelbuild/bazel#14335 has been approved. Would that be sufficient for you to accept this PR or do you want me to update Bazel docs first? |
absolutely, sorry for the delay! |
@phst Friendly ping. Are there any more changes I should make? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few remaining nits
When a target has a runfile that is contained in a directory that is itself one of its runfiles, the runfile will be shadowed by the SymlinkEntry for the directory. While this still allows to resolve the file in the runfiles symlink tree, a manifest-based lookup will fail. This PR extends the lookup logic to also find runfiles contained within directories that are themselves runfiles. It does so by searching the manifest not only for the exact provided rlocation path, but also for all path prefixes. If a prefix is looked up successfully, the corresponding suffix is resolved relative to the looked up path. See bazelbuild/bazel#14336 for more context.
When a target has a runfile that is contained in a directory that is
itself one of its runfiles, the runfile will be shadowed by the
SymlinkEntry for the directory. While this still allows to resolve the
file in the runfiles symlink tree, a manifest-based lookup will fail.
This PR extends the lookup logic to also find runfiles contained within
directories that are themselves runfiles. It does so by searching the
manifest not only for the exact provided rlocation path, but also for
all path prefixes. If a prefix is looked up successfully, the
corresponding suffix is resolved relative to the looked up path.
See bazelbuild/bazel#14336 for more context.