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_rpm cannot set different permissions to the executable in pkg_files and to its runfiles #836

Open
dieortin opened this issue Mar 19, 2024 · 0 comments
Labels
P2 An issue that should be worked on when time is available

Comments

@dieortin
Copy link
Contributor

The problem

pkg_tar automatically detects the executable in pkg_files:

the_executable = get_my_executable(src)

And sets its execution bit:

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

pkg_rpm does not seem to do anything similar, so executables end up with the same file mode as the rest of the files in the provider, which is usually a mode without the execution bit.

Workaround

A workaround is to set the execution bit for the pkg_files target, which will set it for the executable and all its runfiles, but this is not ideal. It would be better if the default was to preserve the file mode of the source file, I think that would work reasonably well.

Future work

This highlights a general issue with the include_runfiles attribute in pkg_files: because the executable and all its runfiles are grouped inside a single PackageFilesInfo provider, there is no granularity to have different attributes or prefixes for different files.

There is also the issue of executables being included twice, as the main target, and as one of the runfiles, which makes a warning show up (file mapped to two different destinations). This should probably have its own issue though.

@aiuto aiuto added the P2 An issue that should be worked on when time is available label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 An issue that should be worked on when time is available
Projects
None yet
Development

No branches or pull requests

2 participants