fix: canonicalize missing components #567
Merged
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.
In 2.x, tars stopped being direct inputs
OCIImage
actions, this meant that none of the tars passed by the user actually went into the sandbox. fixes #566Imagine an oci_image in
examples/env/image
bazel-out/darwin_arm64-fastbuild/bin/external/bash_amd64/data.tar.zst
-> did fail becauseexternal
segment does not exist, therefore can't be canonicalized.bazel-out/darwin_arm64-fastbuild/bin/examples/env/image/data.tar.zst
-> did NOT fail because all components in the path except the file itself existed, therefore can be canonicalized.In the scenario above
realpath
failed if any of the directory segments in the path was missing leading to errors only when external repository labels passed to tars. This fixes the issue by tellingrealpath
to ignore missing segments, and we don't care if the file actually exists on disk.I changed
examples/deb
a bit so that genrule is in the external repo, providing us a test coverage for this.