gradle-graal icon indicating copy to clipboard operation
gradle-graal copied to clipboard

jarFiles @InputFile missing @PathSensitivity to make build-cache effective

Open nhoughto opened this issue 4 years ago • 1 comments

jarFiles currently defined as:

            @InputFile
            public final Provider<RegularFile> getJarFiles() {
                return jarFile;
            }

The default for @InputFile is PathSensitivity of ABSOLUTE, which means if any part of the file path changes, it breaks build caching, which is a strong possibility, esp for CI where the path may have a random element to it.

Adding @PathSensitive(PathSensitivity.RELATIVE) is the easy solution.

nhoughto avatar Jun 15 '21 10:06 nhoughto

There are a few other inputs that force rebuilds too:

windowsVsVarsPath
architectureSpecifiedOutputExtension
executable
cacheDir

I've marked all these as @Internal in my fork and gradle will honour build-cache results as expected.

nhoughto avatar Jun 16 '21 00:06 nhoughto