bazelbuild / rules_pkg

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)
Apache License 2.0
221 stars 174 forks source link

Executable mode is lost on executables added via tree to pkg_tar #847

Open peakschris opened 5 months ago

peakschris commented 5 months ago

When we add a tree to pkg_tar via pkg_files, some files being executable and some not, the executable file modes are lost due to this line: https://github.com/bazelbuild/rules_pkg/blob/a56b1d9d339b70c01f92db74d62f4973a789f0fd/pkg/mappings.bzl#L258

pkg_tar has some code to carry-over executable modes from the underlying files, but this is only active when mode = None, and the above line results in mode always being set explicitly to a default value.

There is no other UI to allow control over executable mode for specific files in tree artifacts.

aiuto commented 5 months ago

Have you tried the "attributes" setting on pkg_files. https://bazelbuild.github.io/rules_pkg/latest.html#pkg_files-attributes