Open
Description
What happened?
The mtree_spec
rule generates an invalid mtree entries for filenames with special characters. For example:
server.runfiles/pypi/_lock/[email protected]/site-packages/setuptools/command/launcher manifest.xml uid=0 gid=0 time=1672560000 mode=0755 type=file content=bazel-out/darwin_arm64-fastbuild-ST-5b66dcbb8b68/bin/external/pypi/_lock/[email protected]/site-packages/setuptools/command/launcher manifest.xml
Causes:
bsdtar: Error reading archive bazel-out/darwin_arm64-fastbuild/bin/server/server_image.packages_tar_manifest.spec: Can't open bazel-out/darwin_arm64-fastbuild-ST-5b66dcbb8b68/bin/external/pypi/_lock/[email protected]/site-packages/setuptools/command/launcher
Filenames should be encoded according to vis
(see man vis
)
In this case it should be encoded as:
server.runfiles/pypi/_lock/[email protected]/site-packages/setuptools/command/launcher\040manifest.xml uid=0 gid=0 time=1672560000 mode=0755 type=file content=bazel-out/darwin_arm64-fastbuild-ST-5b66dcbb8b68/bin/external/pypi/_lock/[email protected]/site-packages/setuptools/command/launcher\040manifest.xml
References:
- https://github.com/vbatts/go-mtree/blob/main/testdata/source.casync-mtree#L127
- https://github.com/vbatts/go-mtree/blob/d54530a564d0beea696c2c616ac0d38ba0b4f5d9/pkg/govis/vis.go#L61
- https://github.com/libarchive/libarchive/blob/master/libarchive/archive_read_support_format_mtree.c#L1942
Version
http_archive(
name = "aspect_bazel_lib",
generator_name = "aspect_bazel_lib",
generator_function = "fetch_dependencies",
urls = ["https://github.com/aspect-build/bazel-lib/archive/40948111707ff0f491d14ea4bd016b78498d14cf.tar.gz"],
sha256 = "b69d39dd191bcd6f4ac6d62b0124ea460caf530bb18ea678c9778fe4046c21f9",
strip_prefix = "bazel-lib-40948111707ff0f491d14ea4bd016b78498d14cf",
)
How to reproduce
No response
Any other information?
No response