Open CXwudi opened 1 year ago
I have the same issue, do you have any workaround except disabling configuration cache entirely?
@morki neither did I know
we use these flags to get around those warnings (YMMV):
org.gradle.configuration-cache = true
org.gradle.configuration-cache.problems = warn
org.gradle.configuration-cache.stable = true
and, if necessary, in settings.gradle.kts
:
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
cc/ @morki @CXwudi
@sgammon Based on the documentation:
The configuration cache is automatically invalidated when inputs to the configuration phase change. However, certain inputs are not tracked yet, so you may have to manually invalidate the configuration cache when untracked inputs to the configuration phase change. This can happen if you ignored problems.
I wouldn't say org.gradle.configuration-cache.problems = warn
is a long term solution
@CXwudi certainly not, but my configuration cache is working so i figured i'd help with a WA. i was here to report my own configuration cache issue so even these flags don't completely solve it.
Before reporting
Describe the bug The task
collectReachabilityMetadata
fails with Gradle's configuration cache enabledTo Reproduce Use Gradle 8.1, create a new application type Java project using
gradle init
, enable configuration cache, and add the native gradle plugin in thebuild.gradle.kts
Or use this minimal reproducible sample, test.zip
Run
./gradlew app:collectReachabilityMetadata
Expected behavior
The Gradle command should run successfully
Logs
🚀 ./gradlew app:collectReachabilityMetadata Encryption of the configuration cache is enabled. Calculating task graph as no configuration cache is available for tasks: app:collectReachabilityMetadata
FAILURE: Build failed with an exception.
25 problems were found storing the configuration cache, 5 of which seem unique.
:app:collectReachabilityMetadata
of typeorg.graalvm.buildtools.gradle.tasks.CollectReachabilityMetadata
: cannot serialize object of type 'org.gradle.api.artifacts.Configuration' as these are not supported with the configuration cache. See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types:app:collectReachabilityMetadata
of typeorg.graalvm.buildtools.gradle.tasks.CollectReachabilityMetadata
: execution of task ':app:collectReachabilityMetadata' caused invocation of 'Task.convention' in other task at execution time which is unsupported. See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution:app:collectReachabilityMetadata
of typeorg.graalvm.buildtools.gradle.tasks.CollectReachabilityMetadata
: execution of task ':app:collectReachabilityMetadata' caused invocation of 'Task.project' in other task at execution time which is unsupported. See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution:app:collectReachabilityMetadata
of typeorg.graalvm.buildtools.gradle.tasks.CollectReachabilityMetadata
: invocation of 'Task.project' at execution time is unsupported. See https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_executionSee the complete report at file:///D:/coding-workspace/jvm-project/experiment/test/build/reports/configuration-cache/f08dxrrrchazgw6h5vryx7ytw/70mwsvs3jo0tz5pug7tk4107v/configuration-cache-report.html
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 3s 1 actionable task: 1 executed
Also, the
configuration-cache-report.html
file -> configuration-cache-report.zipSystem Info:
22.3 CE
17
native-gradle-plugin:0.9.21
Additional context This issue is similar but not too similar to #338, this compatibility issue comes from the
CollectReachabilityMetadata
task. This task is used by thebootJar
task from the Spring Gradle plugin. So it actually breaks Spring plugin when configuration cache is enabled../gradlew build
and./gradlew nativeBuild
are not affected, if we don't let themdependsOn
thecollectReachabilityMetadata
task.