StefMa
02/10/2023, 12:22 PMtopLevel
includeBuild("app")
includeBuild("library")
topLevel/app
includeBuild("../library")
topLevel/library
In words, the top-level project includes "the app" and "the library" via composite builds and "the app" includes "the library" via composite builds.
By default we have open the "topLevel" project so that we can make changes in the library as well as in the app in our IDE.
library as well as app are multi-module android projects.
Now we wanted to take a look at the configuration cache.
We enabled the cache for all three projects.
If I run assembleDebug
on the library project everything works as expected.
I don't get any issues.
If I run assemble[BuildFlavor]Debug
within "the app" project, I also don't get any configuration cache issues. Gradle tells me that the cache was stored and found 0 issues.
If I run it the second time (so the configuration cache will be restored) I get a (build?) error with the message:
> Error while evaluating property 'filteredArgumentsMap' of task ':library:lib😮ptional:kaptGenerateStubsDebugKotlin'.
> GradleProperties has not been loaded yet.I get this even for several sub-projects of the library. Not only for one, but also not for all. The stacktrace doesn't help me either. I use Gradle 7.6, Kotlin 1.7.21 and the AGP 7.4.0 I (may) found related issues: https://youtrack.jetbrains.com/issue/KT-56478 https://youtrack.jetbrains.com/issue/KT-48756 https://github.com/gradle/gradle/issues/13122 But none of them helped me. And I'm also not sure if this is an kapt issue or rather an Gradle issue. A reason why I also want to raise this here. Is this an known issue in Gradle? Can I workaround this somehow? Or can anybody help me here? Thanks in advance and happy Friday and weekend to all 🙂
Martin
02/17/2023, 6:22 PM@Internal
task fields? I'm guessing it's OK to have @Internal
fields as long as they are Serializable
? But anything else will probably fail, right?Eug
02/20/2023, 3:40 PMRyan Schmitt
02/22/2023, 8:30 PMAdam
02/23/2023, 9:41 PMrrva
02/26/2023, 11:19 AMJavi
03/05/2023, 11:14 AM32 problems were found storing the configuration cache, 2 of which seem unique.
- Plugin 'com.javiersc.semver.gradle.plugin': Project ':library-a' cannot dynamically look up a property in the parent project ':'
- Plugin 'com.javiersc.semver.gradle.plugin': Project ':library-b' cannot dynamically look up a property in the parent project ':'
I am accessing using the typical properties["..."]
, so Gradle knows that the properties are in the root gradle.properties
. This is a new limitation with Gradle 8 and I should move those properties to each project? It can be annoying as it is a property that can be shared on all projects.Audrius
03/07/2023, 11:25 AMCalculating task graph as configuration cache cannot be reused because the set of environment variables prefixed by 'ORG_GRADLE_PROJECT_' has changed.
- GradleEnterprise scan diff shows no difference between builds
- build/reports/configuration-cache
report the same values, just some variables have different positions in the file.
How can I find the cause of this cache miss?
(Gradle version 8)melix
03/09/2023, 8:29 AMmicronaut-test-resources
) which does not use parallel builds, because of some tests which are resource intensive.Sergey Lapin
03/14/2023, 1:42 PMReusing configuration cache.
message but the build fails with ClassNotFoundException
(stacktrace in thread). Locally everything works perfectly.
Is managing .gradle/configuration-cache
persistence and providing reproducible environment not sufficient to enable CC on CI, or am I missing something?melix
03/14/2023, 4:00 PMmelix
03/14/2023, 4:24 PMmelix
03/18/2023, 11:02 AMVampire
03/22/2023, 1:31 PMNikolay
03/29/2023, 4:57 PMapplication
plugin. We have specified the following configuration.
applicationDefaultJvmArgs = listOf(
"--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED",
"--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens=java.base/java.io=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED")
It seems that if the configuration cache is used those JVM args do not get passed to the process. If we run gradle with --no-configuration-cache
then everything works as expected.
Anybody have any ideas? We are running the gradle run
task.Chris Doré
03/30/2023, 9:15 PMInstrumented.fileObserved
call for the config cache. Is this something I'll need to port into my init script once I upgrade and start using the CC? Is there a more public API way of doing what's necessary?grossws
04/03/2023, 4:29 PMgradle.taskGraph.whenReady { .. }
) and operations on it configuration cache compatible?
Will I just receive cached graph?Nikolay
04/06/2023, 8:29 AMJavi
04/13/2023, 4:51 PMAdam
04/17/2023, 10:49 AMTask `:subproject-hello:dokkatooGenerateModuleHtml` of type `dev.adamko.dokkatoo.tasks.DokkatooGenerateTask`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
I’m using .kt
files to write the plugin, not .kts
files, so I don’t know why the error is saying there’s a problem with a Gradle scripts?
Reproducer in 🧵Matt Groth
04/20/2023, 8:34 PMOperationCompletionListener
and FlowAction
. These are both config-cache compatible mechanisms for receiving events, the former for task-finished events and the latter for build-finished events. Is there a reason they are completely seperate APIs? Are there plans to merge them?René
04/20/2023, 10:33 PM* What went wrong:
Configuration cache problems found in this build.
1 problem was found storing the configuration cache.
- Plugin 'elasticsearch.global-build-info': external process started 'sysctl -n hw.physicalcpu'
See <https://docs.gradle.org/8.1/userguide/configuration_cache.html#config_cache:requirements:external_processes>
The related userguide didn't help much. Is that a known issue? is there a workaround/fix for this?Eli Graber
04/24/2023, 2:40 AMproject
in Task.onlyIf
cause invocation of 'Task.project' at execution time is unsupported.
when config cache is enabled?
I started getting this error after updating to Gradle 8.1 and the only thing in the task that's referencing project
is in the onlyIf
https://github.com/Triple-T/gradle-play-publisher/issues/1083
https://github.com/Triple-T/gradle-play-publisher/blob/master/play/plugin/src/main/kotlin/com/github/triplet/gradle/play/tasks/CommitEdit.kt#L21Matt Groth
05/07/2023, 11:53 PMstandardInput
of org.gradle.api.tasks.JavaExec
to <http://System.in|System.in>
? I got this error:
FAILURE: Build failed with an exception.
* What went wrong:
Maximum number of configuration cache problems has been reached.
This behavior can be adjusted, see <https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:usage:max_problems>.
1 problem was found storing the configuration cache.
- Task `:my:task` of type `org.gradle.api.tasks.JavaExec`: cannot serialize object of type 'java.io.PipedInputStream', a subtype of 'java.io.InputStream', as these are not supported with the configuration cache.
See <https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
The context is I have a JavaExec
task that requires user input from the command line at runtimeSid B
05/19/2023, 4:30 AMtasks.processResources {
filesMatching("**/version.txt") {
filter { line: String ->
getTemplatedString(line)
}
}
}
fun getTemplatedString(input: String) : String {
.......
.......
.......
return "something"
}
I am trying to build convention plugin with this logic. When I enable configuration cache, I get this error -
1 problem was found storing the configuration cache.
- Task :processResources
of type `org.gradle.language.jvm.tasks.ProcessResources`: cannot serialize Gradle script object references as these are not supported with the configuration cache.
How do I make this compatible with configuration cache?Andrea Di Menna
05/24/2023, 11:16 AMFAILURE: Build failed with an exception.
* What went wrong:
Configuration cache problems found in this build.
2 problems were found storing the configuration cache, 1 of which seems unique.
- Task `:redacted:generateReleaseProto` of type `com.google.protobuf.gradle.GenerateProtoTask`: invocation of 'Task.project' at execution time is unsupported.
See <https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution>
See the complete report at file:///redacted/build/reports/configuration-cache/3mf8hghvfa02wwvtjlwqc59gg/cy6abpuc9o24o4cjazezyewuu/configuration-cache-report.html
> Invocation of 'Task.project' by task ':redacted:generateReleaseProto' at execution time is unsupported.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
I do not get that error locally on my machine.
What could be different between my settings and the CI machine’s one?
How can I diagnose such errors?Andrea Di Menna
05/24/2023, 4:34 PMcannot serialize Gradle script object references as these are not supported with the configuration cache.
as an error in configuration cache storage?Clayton Walker
05/30/2023, 5:51 PMClayton Walker
05/31/2023, 3:44 PMpProject.getTasks().withType(JacocoReport.class, reportTask -> {
eager evaluates each jacocoreport (I believe?) but I’m not sure how to dynamically add a task without configuring the former. whenTaskAdded didn’t seem to work, and configureEach doesn’t let you register a task (perhaps it runs too late?)twisterrob
06/06/2023, 10:30 AMTaskExecutionGraph
). I want to call taskGraph.hasTask("...")
in the @TaskAction
of a Task
.
I tried injecting Gradle
, TaskExecutionGraph
, all kinds of project.provider
and even ValueSource
, but no luck yet. What's the right way?