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

execute bit lost in target directory #4

Open
ddresser opened this issue Jan 9, 2018 · 3 comments
Open

execute bit lost in target directory #4

ddresser opened this issue Jan 9, 2018 · 3 comments

Comments

@ddresser
Copy link

ddresser commented Jan 9, 2018

I am experiencing a situation where executable files in the root directory are no longer executable in the target directory after running ./gradlew applyPatches

Here's my config:

plugins {
    id 'uk.jamierocks.propatcher' version '1.2.3'
    id 'java'
}

patches {
  root = file("${buildDir}/tensorflow") // This is a directory
  target = file("${buildDir}/tensorflow.patched") // This is also a directory
  patches = file('patches') // This is again a directory
}

There is a single patch in the patch directory.

build@tensorflow-build:/src/acadia/tensorflow_gradle$ ls -l patches/
total 4
-rw-r--r-- 1 build build 1572 Jan  8 21:55 build_raspberry_pi.sh.patch.txt

./gradlew applyPatches results in the execute bit being lost on all executable files in the target directory. For example:

in the root directory:
-rwxr-xr-x 1 build build 231 Jan 9 14:13 configure

in the target directory:
-rw-r--r-- 1 build build 231 Jan 9 14:13 configure

umask shows:

build@tensorflow-build:/src/acadia/tensorflow_gradle$ umask
0022

so I don't believe that is the issue. Any ideas? Thanks.

@jamierocks
Copy link
Member

Hadn't thought of preserving permissions from the root - will get that resolved ASAP ;)

@ddresser
Copy link
Author

Thank you, and thanks for the plugin.

@jamierocks
Copy link
Member

As of Java 7, file permissions are exposed (see journaldev) - however, as different operating systems have different forms of file permission (e.g. Windows has it own attributes system).

Therefor, I have decided to omit supporting this as the default functionality as it won't work everywhere. However, I have added a copyPosixPermissions field for the propatcher extension for enabling the functionality.

I have not made a release with these changes yet, as I won't have time to get them tested until some point in the weekend (I might have time to test on Saturday, but if not Sunday). However, I have pushed the commit (d6dbbf4) should you want to test it out yourself - I can provide instructions on doing that if you'd like ;)

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

No branches or pull requests

2 participants