You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg_tar maps files based on each file's short_path attribute. If a file package/file.txt belongs to an external repository, extrepo, short_path evaluates to ../extrepo/package/file.txt. pkg_tar with strip_prefix="." then creates archives with invalid ../ pathname elements:
$ tar -tf test-tar-strip_prefix-dot.tar././etc/./etc/nsswitch.conftar: Removing leading `./..' from member names./../tar: Removing leading `./../' from member names./../bazel_tools/./../bazel_tools/tools/./../bazel_tools/tools/python/./../bazel_tools/tools/python/runfiles/./../bazel_tools/tools/python/runfiles/runfiles.py
The text was updated successfully, but these errors were encountered:
Avoid use of [`File.short_path`][1] when mapping filenames, because when
creating archives from files imported from external repositories we'll create
archive members with leading `./../` prefixes. Instead, we'll stick to stripping
to leading `File.root.path` (if present) from `File.path`, resulting in archive
members like `external/repo/package/file.txt`.
[1]: https://docs.bazel.build/versions/master/skylark/lib/File.html#short_pathResolves#131.
pkg_tar
maps files based on each file'sshort_path
attribute. If a filepackage/file.txt
belongs to an external repository,extrepo
,short_path
evaluates to../extrepo/package/file.txt
.pkg_tar
withstrip_prefix="."
then creates archives with invalid../
pathname elements:The text was updated successfully, but these errors were encountered: