Support runfiles root_symlinks in images #2250
Open
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.
Fixes symlink support and adds root_symlink support.
PR Checklist
Please check if your PR fulfills the following requirements:
^ I'm not aware of docs that mention what specifically happens to runfiles.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Previously I was seeing that
runfiles.symlinks
(regardless of whether the target file existed inrunfiles.files
), did not point to the correct location in the image (they were broken).Additionally,
root_symlinks
were entirely ignored.Issue Number: N/A
What is the new behavior?
The overall method we take here is to create real files where the [root_]symlink is declared if the target
File
is not seen infile_map
.We now use
_final_file_path
instead oflayer_file_path
. This seems to work, but I am not sure if I'm missing a use-case here.This PR also adds some extra test functionality to check that symlinks point at the expected location.
Does this PR introduce a breaking change?
I don't think that the previous behavior is considered working, and I'm having trouble imagining a case where that broken behavior would be desired.
Other information