Java.io.tmpdir not obeyed by ProjectBuilder when testing

not-a-bug

(John Scancella) #1

Gradle Version: 2.13
Operating System: mac
Is this a regression? If yes, which version of Gradle do you know it last worked for? unknown

I posted this in the help forum as well but since there hasn’t been much luck I thought I would post here

https://github.com/LibraryOfCongress/simple-artifact-uploader/blob/master/src/test/java/gov/loc/repository/ArtifactoryPluginTest.java#L302 is causing a

Caused by: java.lang.UnsatisfiedLinkError: /tmp/gradle1671374982016007532projectDir/userHome/native/19/linux-amd64/libnative-platform.so: /tmp/gradle1671374982016007532projectDir/userHome/native/19/linux-amd64/libnative-platform.so: failed to map segment from shared object: Operation not permitted

even when -Djava.io.tmpdir is set to a different directory.

to reproduce

  1. clone https://github.com/LibraryOfCongress/simple-artifact-uploader.git on a server that has /tmp mounted with noexec
  2. run gradle gradle test -Djava.io.tmpdir=
    it still tries to use /tmp as the unpack space for ProjectBuilder

(John Scancella) #2

Have any of the developers been able to take a look at this?


(Stefan Wolf) #3

Hi John,

you probably need to pass the property to the Test, not to Gradle itself. How to do this is documented here. Does that solve your problem?

Regards,
Stefan


(John Scancella) #4

It does solve my problem. However I find it confusing that for that particular case gradle tests don’t inherit that setting.

Thanks


(Stefan Wolf) #5

Hi John,

Gradle tests newer inherit system properties - all system properties for the tests need to be passed explicitly via the configuration of the Test task. Could you give me an example when you saw a system property inherited to the test?

Regards,
Stefan


(John Scancella) #6

It inherits which JVM I use because it is set via JAVA_HOME which is a system property.

Anyways, thanks again for all the help.