Skip to content

[Bug]: mtree_spec rule does not encode filenames with special characters  #17

Open
@pcj

Description

@pcj

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:

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions