Java.io.tmpdir not obeyed by ProjectBuilder when testing

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 GitHub - LibraryOfCongress/simple-artifact-uploader: A plugin for the Gradle build management tool that allows us to automatically upload completed binaries to the Artifactory deployment server. 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

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

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

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

Thanks

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

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.