gradle-errorprone-plugin icon indicating copy to clipboard operation
gradle-errorprone-plugin copied to clipboard

Gradle Build Cache Misses due to errorProne compileArgumentProvider

Open simschla opened this issue 5 months ago • 1 comments

Using the latest 4.0.1 version, we see the following issue regarding our build: On compileJava tasks where errorProne plugin is applied, the calculated cache key for this input differs between developer machines and the CI, leading to cache misses and therefore (unnecessary) task execution.

While investigating these cache misses, the discovered issue seems to be options.compilerArgumentProviders.errorprone$0.errorproneOptions.

Running the gradle command with -Dorg.gradle.caching.debug=true we see the following output (on the exact same code version):

CI

<snip>
Appending input value fingerprint for 'options.compilerArgs' to build cache key: 8222d82255460164427051d7537fa305
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0' to build cache key: 482194bd82177370c0aa4de0611711b1
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions' to build cache key: 42061d0c8586e88cfe001e1553e25e02
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.allDisabledChecksAsWarnings' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.allErrorsAsWarnings' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.checkOptions' to build cache key: cfcc5f871f42c7c797557fd17748dc17
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.checks' to build cache key: 3fb1f830072cc673a4c4d28e1ec08801
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.compilingTestOnlyCode' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.disableAllChecks' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.disableAllWarnings' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.disableWarningsInGeneratedCode' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.enabled' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.errorproneArgs' to build cache key: 8222d82255460164427051d7537fa305
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.excludedPaths' to build cache key: 13e6fa94b7591e9078168521fc23b783
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.ignoreSuppressionAnnotations' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.ignoreUnknownCheckNames' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
<snip>

Local developer machine:

<snip>
Appending input value fingerprint for 'options.compilerArgs' to build cache key: 8222d82255460164427051d7537fa305
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0' to build cache key: 1ec70c21c8cef529e40980bf67375a24
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions' to build cache key: d34ccfacb244f1e4266aaa57615fb609
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.allDisabledChecksAsWarnings' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.allErrorsAsWarnings' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.checkOptions' to build cache key: cfcc5f871f42c7c797557fd17748dc17
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.checks' to build cache key: 3fb1f830072cc673a4c4d28e1ec08801
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.compilingTestOnlyCode' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.disableAllChecks' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.disableAllWarnings' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.disableWarningsInGeneratedCode' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.enabled' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.errorproneArgs' to build cache key: 8222d82255460164427051d7537fa305
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.excludedPaths' to build cache key: 13e6fa94b7591e9078168521fc23b783
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.ignoreSuppressionAnnotations' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions.ignoreUnknownCheckNames' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
<snip>

The difference being in these lines:

Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0' to build cache key: 1ec70c21c8cef529e40980bf67375a24 //<-- this is 482194bd82177370c0aa4de0611711b1 on CI
Appending input value fingerprint for 'options.compilerArgumentProviders.errorprone$0.errorproneOptions' to build cache key: d34ccfacb244f1e4266aaa57615fb609 //<-- this is 42061d0c8586e88cfe001e1553e25e02 on CI

~~This must be a regression introduced in 4.0 or 4.0.1 since the issue was not there with 3.1.0~~ Sorry, no regression, is already present in 2.0.2

Is there an easy way this can be fixed?

simschla avatar Sep 09 '24 10:09 simschla