[GRADLE-3165] temporary folder (/tmp) filled up with gradle_uploadXXXSHA1 files Created: 08/Sep/14  Updated: 08/Sep/14  Resolved: 08/Sep/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.2-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

Hello,

I configured my CI server to publish artifacts in an ivy local repository. So it does it about every minute
Each time, this leads to a gradle_uploadXXXSHA1 file into /tmp for each artifact for each build that seems never cleaned up. several hundreds files per day :/

I use with gradle 1.11, below is my publishing conf.

Is this a known bug, or is there an option to avoid this ?

publishing {
repositories {
ivy {
url "${System.properties['user.home']}/.ivy2/local"
}
}
publications {
ivy(IvyPublication) {
organisation 'xxx'
from components.java
artifact(sourcesJar) {
type 'sources'
}
}
}



 Comments   
Comment by Gradle Forums [ 08/Sep/14 ]

I use 2.0 and I face the same problem. My CI server is on an SSD and it builds at least 60 builds a day, so my /tmp gets flooded with the temp files. Hope someone from the gradle team can share some info on this.

Comment by Gradle Forums [ 08/Sep/14 ]

`/tmp` should get cleaned by your OS. If this isn't the case, add a cron job that schedules `tmpwatch` or similar.

Comment by Gradle Forums [ 08/Sep/14 ]

It does surprise me that gradle does not clean up temporary folders once it is done with them.

Maybe a useful feature would be to add a `--gradle-tmpdir` command-line option. Would work really well for CI.

Peter, is the gradle tmp dir based upon Java's tmpdir, therefore being controllable via a `-D` system property?

Comment by Gradle Forums [ 08/Sep/14 ]

Typically, Gradle puts temp files into either the Java temp dir or `build/tmp`. It might be worthwhile to check if `gradle_uploadXXXSHA1` is written by Gradle or an underlying library, and if it's written by Gradle, use `Task#getTemporaryDir` (which will go under `build/tmp`).

Comment by Gradle Forums [ 08/Sep/14 ]

This does remind me. In unit testing code for gradle plugins one has to set the projectDir to something below `build/tmp` otherwise by default it would create a directory under the OS's temp directory.

Generated at Wed Jun 30 12:41:40 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.