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

Fix executable file permissions in archives #1545

Closed
wants to merge 1 commit into from

Conversation

mzeijen
Copy link
Contributor

@mzeijen mzeijen commented Jun 17, 2024

This change fixes that any file generated with the executable file permission is stored within the tgz or zip archive with executable file permission.

Before this change only Maven and Gradle wrapper scrips would get executable file permission within the archive, even though classes like MultipleResourcesProjectContributor allow for setting the executable file permission on other generated files.

This change allows any file generated with the executable file
permission to be stored within the tgz or zip archive with executable
file permission.

Before this change only Maven and Gradle wrapper scrips would get
executable file permission within the archive, even though classes like
MultipleResourcesProjectContributor allow for setting the executable
file permission on other generated files.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 17, 2024
@mhalbritter
Copy link
Contributor

Hello,

thanks for the PR. Is there a use case behind this PR, e.g. you tried to add an executable file which doesn't turn up executable in the archive?

@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Jun 21, 2024
@mzeijen
Copy link
Contributor Author

mzeijen commented Jun 21, 2024

Yes, in my company we have a application build upon Spring Initializr and we just added new generated shell files that need to be executable. Out of the box these new files are not made executable in the zip/tgz archive as only the Maven and Gradle wrapper scripts are made executable. We had to implement a very ugly hack to get it working.

We would really like to have Spring Initializr to support having any file executable so that we can get rid of the ugly workaround.

FYI: I also created a ticket with Jetbrains regarding their Spring Initializr integration, because Intellij also only makes the Maven and Gradle wrapper scripts executable, even if other files in the archive are executable. Luckily we also have a web GUI that uses our variant of Spring Initializr that is more often used nowadays to generate projects.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jun 21, 2024
@mhalbritter
Copy link
Contributor

Thanks. So my problem with the approach in the PR is that it uses the executable bit from the filesystem to check if the file should be executable in the archive. That means, running that on windows will make every file in the archive executable. I think we should add some other functionality (e.g. archive customizer) to initializr, which supports your use case.

@mhalbritter
Copy link
Contributor

I've opened #1549 for that. Thanks for the PR anyway!

@mhalbritter mhalbritter added status: declined and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Jun 24, 2024
@mzeijen
Copy link
Contributor Author

mzeijen commented Jun 25, 2024

Ah, I hadn't thought of the Windows use-case. I totally agree that this then isn't an acceptable solution.

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

Successfully merging this pull request may close these issues.

3 participants