Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_files remove the executable permission to generated executable #786

Open
CareF opened this issue Nov 22, 2023 · 1 comment
Open

pkg_files remove the executable permission to generated executable #786

CareF opened this issue Nov 22, 2023 · 1 comment

Comments

@CareF
Copy link

CareF commented Nov 22, 2023

Say I have

cc_binary(
    name = "foo",
    ....
)

pkg_files(
    name = "foo_files",
    srcs = [":foo"],  # in practice it also include other files to become a group
)

pkg_tar(
    name = "foo_tar",
    srcs = [":foo_files"],
)

The foo file in the tarball will have permission 644:

out_attributes.setdefault("mode", "0644")

It seems to me counter intuitive. Should the above line be None rather than 644? or am I misunderstood the usage of pkg_files?

@dieortin
Copy link
Contributor

When adding files to a PackageFilesInfo from DefaultInfo, the executable is detected and its permissions are changed to 0755

fmode = "0755" if f == the_executable else mapping_context.default_mode

I'm not sure why that wouldn't be happening here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants