You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No error produced when using the --rerun option with configuration cache enabled.
Current Behavior
Running a Gradle task with the new --rerun option will break on a configuration cache hit.
Context
The new --rerun option implemented in 7.6 (by yours truly) was not tested with configuration cache enabled, but it clearly does not work.
This seems similar to #20296 (in a sense that could benefit from a similar workaround - using using a non-anonymous type implementing a SAM interface instance instead of a lambda, as per docs) or #21109, more specifically for this lambda in OptionReader BUILT_IN_OPTIONS.
Steps to Reproduce
Make sure you are using a more or less recent 7.6 snapshot build. I used:
which succeeds. But a second call (configuration cache hit) fails:
Issue the same command again:
./gradlew help --configuration-cache --rerun
results in:
Configuration cache is an incubating feature.
Reusing configuration cache.
FAILURE: Build failed with an exception.
* What went wrong:
Could not load the value of field `specs` of `org.gradle.api.specs.AndSpec` bean found in task `:help` of type `org.gradle.configuration.Help`.
> org.gradle.api.internal.tasks.options.OptionReader$$Lambda$1125/0x000000080095b440
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
CONFIGURE FAILED in 397ms
Publishing build scan...
https://e.grdev.net/s/nmvg6nbfsqkg2
Configuration cache entry reused.
Stacktrace:
Caused by: java.lang.ClassNotFoundException: org.gradle.api.internal.tasks.options.OptionReader$$Lambda$1125/0x000000080095b440
at org.gradle.configurationcache.serialization.DefaultReadContext.readClass(Contexts.kt:285)
at org.gradle.configurationcache.serialization.codecs.BeanCodec.decode(BeanCodec.kt:44)
at org.gradle.configurationcache.serialization.CombinatorsKt$reentrant$1$decodeLoop$1.invokeSuspend(Combinators.kt:165)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
at org.gradle.configurationcache.serialization.CombinatorsKt$reentrant$1.decodeLoop(Combinators.kt:166)
at org.gradle.configurationcache.serialization.CombinatorsKt$reentrant$1.decode(Combinators.kt:130)
at org.gradle.configurationcache.serialization.codecs.BindingsBackedCodec.decode(BindingsBackedCodec.kt:59)
at org.gradle.configurationcache.serialization.DefaultReadContext.read(Contexts.kt:259)
at org.gradle.configurationcache.serialization.CodecKt.readNonNull(Codec.kt:96)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec.readUpToDateSpec(TaskNodeCodec.kt:153)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec.access$readUpToDateSpec(TaskNodeCodec.kt:64)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec$readTask$2.invokeSuspend(TaskNodeCodec.kt:123)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec$readTask$2.invoke(TaskNodeCodec.kt)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec$readTask$2.invoke(TaskNodeCodec.kt)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodecKt.withTaskOf(TaskNodeCodec.kt:230)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodecKt.access$withTaskOf(TaskNodeCodec.kt:1)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec.readTask(TaskNodeCodec.kt:122)
at org.gradle.configurationcache.serialization.codecs.TaskNodeCodec.decode(TaskNodeCodec.kt:75)
at org.gradle.configurationcache.serialization.codecs.BindingsBackedCodec.decode(BindingsBackedCodec.kt:59)
at org.gradle.configurationcache.serialization.DefaultReadContext.read(Contexts.kt:259)
at org.gradle.configurationcache.serialization.CodecKt.readNonNull(Codec.kt:96)
at org.gradle.configurationcache.serialization.codecs.WorkNodeCodec.readNode(WorkNodeCodec.kt:96)
at org.gradle.configurationcache.serialization.codecs.WorkNodeCodec.readNodes(WorkNodeCodec.kt:83)
at org.gradle.configurationcache.serialization.codecs.WorkNodeCodec.readWork(WorkNodeCodec.kt:59)
at org.gradle.configurationcache.ConfigurationCacheState.readWorkGraph(ConfigurationCacheState.kt:262)
at org.gradle.configurationcache.ConfigurationCacheState.readBuildState$configuration_cache(ConfigurationCacheState.kt:234)
at org.gradle.configurationcache.ConfigurationCacheState.readRootBuild(ConfigurationCacheState.kt:191)
at org.gradle.configurationcache.ConfigurationCacheState.readRootBuildState(ConfigurationCacheState.kt:119)
...
A similar issue happens with any other task, for instance:
The configuration cache chokes on non-serializable lambdas.
This works around that issue by using a serializable spec.
Issue: #21748
Co-authored-by: Rafael Chaves <rchaves@gradle.com>
Expected Behavior
No error produced when using the --rerun option with configuration cache enabled.
Current Behavior
Running a Gradle task with the new
--rerun
option will break on a configuration cache hit.Context
The new
--rerun
option implemented in 7.6 (by yours truly) was not tested with configuration cache enabled, but it clearly does not work.This seems similar to #20296 (in a sense that could benefit from a similar workaround - using using a non-anonymous type implementing a SAM interface instance instead of a lambda, as per docs) or #21109, more specifically for this lambda in
OptionReader
BUILT_IN_OPTIONS.Steps to Reproduce
distributionUrl=https://services.gradle.org/distributions-snapshots/gradle-7.6-20220830021557+0000-bin.zip
./gradlew help --configuration-cache --rerun
which succeeds. But a second call (configuration cache hit) fails:
./gradlew help --configuration-cache --rerun
results in:
Stacktrace:
A similar issue happens with any other task, for instance:
Your Environment
MacOS
Gradle 7.6 and 7.7
Build scan URL:
https://e.grdev.net/s/nmvg6nbfsqkg2
The text was updated successfully, but these errors were encountered: