Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-14780] ensure gradlew is executable
- Loading branch information
Showing
1 changed file
with
1 addition
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is chmod argument '0744', not '744' ?
When I use gradle plugin Ver 1.18 included this code,
gradlew permission is broken after build execution and build error.
So, i clone source code and change to '0744', build becomes success.
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chmod argument is an int, so 744 == 0744, isn't it ?
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually in java a leading zero means octal. Therefore, 0744 == 508, isn't it?
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all SCM don't restore the executable bit, so running gradlew requires a pre-build step do chmod +x. The plugin handle this makes sense imho
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other issue to consider - chmod'ing a file in Git counts as a change to the gradle wrapper file. Is this likely to cause an issue? Perhaps it could be changed to only chmod the file if it isn't already executable (as for instance in my case I changed the Git version of the wrapper to come out with the correct mask) and then only change the user bit rather than the rest of the mask?
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that I am as rbywater saying.
chmod need not be executed when SCM support to restore file permission (like Git) , and shouldn't.
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I would support this as an option for those that require it (I'm guessing if your SCM doesn't retain the permissions mask that it won't care about it changing) but don't like the idea of doing it by default.
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will make this an option
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed at a3dc7bc
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i pull code and run test, and it's ok.
Thanks a lot!
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot for very constructive discussion here
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please publish a new release of the plugin with the patch from @ndeloof?
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd need to try out a new version as well: right now 1.18 sets ./gradlew permissions to "--wxr-x--T" making it unusable.
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.19 released
48d9a22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Not checking the checkbox (we have wrapper script already executable in the GitHub) solved my permissions issue. And checking it also works.