Auto Generated build folders

buildship
not-a-bug

(Rodrigo Monge) #1

We’ve noticed gradle auto generates folders (from what I think is SHA1) when building, like this:
Repository/”project_name”/objs/”component_name”/static/”component_name”C/1c3x6nwh709wxjpxk4o9d7nj0
I would like to know where is this being generated, because for certification purposes our builds need to be replicated exactly every time and by having this randomized behavior makes this impossible unless we use the exact same machine building from the exact same place.
This may not affect other people so we would be happy knowing how this works and we could make the change to have this values fixed.


(Sterling Greene) #2

Hi @rodrigomonge-ge,

It happens here: https://github.com/gradle/gradle/blob/150157c9b117aa3e695277c1ddcb5fa07cbd736b/subprojects/platform-native/src/main/java/org/gradle/nativeplatform/internal/CompilerOutputFileNamingScheme.java#L45-L48

This should be stable across machines (it’s not random). Which version of Gradle are you using?


(Rodrigo Monge) #3

Using version 4.2, when we build on different machines we are getting different results, specially because each developer decides where to locate their project folder, and my guess is this value takes into account the place where it’s being built from, for example

C:\project\build.gradle
C:\folder1\project\build.gradle
C:\folder1\folderN\build.gradle
or even on a different drive

If we build on this 3 different locations different hash will be made, which conflicts with our need for “always the same result”


(Sterling Greene) #4

I don’t remember a change between 4.2 and now to fix that behavior, but if you take this sample: https://github.com/gradle/native-samples/tree/master/cpp/application

I’ve built it from 3 different locations and got the same path for all of them. We intentionally do not include the absolute path into the calculation of that hash.

If you’re seeing something different, a reproducible example would be very helpful.