pkg_rpm
cannot set different permissions to the executable in pkg_files
and to its runfiles
#836
Labels
P2
An issue that should be worked on when time is available
The problem
pkg_tar
automatically detects the executable inpkg_files
:rules_pkg/pkg/private/pkg_files.bzl
Line 395 in c53ff51
And sets its execution bit:
rules_pkg/pkg/private/pkg_files.bzl
Line 411 in c53ff51
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 inpkg_files
: because the executable and all its runfiles are grouped inside a singlePackageFilesInfo
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.
The text was updated successfully, but these errors were encountered: