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

Incompatibility with 'application' plugin; startup scripts no longer executable #7

Open
cloudshiftchris opened this issue Sep 18, 2024 · 4 comments
Labels
a:bug Something isn't working

Comments

@cloudshiftchris
Copy link

When applied with the application plugin the startup scripts (via distZip task) no longer have executable bit set.

@jjohannes
Copy link
Member

Thank you for opening the issue @cloudshiftchris.

@britter already brought this up, but we forgot to create an issue here.

@jjohannes jjohannes added the a:bug Something isn't working label Sep 20, 2024
@britter
Copy link
Member

britter commented Sep 20, 2024

Yeah, I think we can be more clever in preserving the execute permissions for some files. We could react to the presence of the application plugin and find the scripts it creates. We could also look for well known file extensions such as .sh or .bat. Finally we could inspect files to see whether they start with a shebang line.

@cloudshiftchris
Copy link
Author

I'd assumed (incorrectly) that CopySpec would use the permissions as 'defaults' if nothing more specific (i.e. child copy specs, etc) were provided.
Ideally we'd find a way to provide defaults such that we don't fall back to OS-inconsistent ones.

@jjohannes
Copy link
Member

For the start scripts, the permission is set to a fixed value by the application plugin:
https://github.com/gradle/gradle/blob/7f6e34676041df34961420edd3cf95e6b7b9f762/platforms/jvm/plugins-application/src/main/java/org/gradle/api/plugins/ApplicationPlugin.java#L229

Which means that these archive entries are already reproducible.

The best solution would be to not override this, but only set permissions for all other files (for which no default/convention exists).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants