Gasper Kojek
04/19/2022, 10:22 AMCalculating task graph as configuration cache cannot be reused because the set of Gradle properties has changed.
How can I find out which properties (that affect configuration cache) are changed? There should be no changes, as this pops up even on builds on the same commit?Vampire
04/19/2022, 11:27 AMPaul Merlin
04/19/2022, 2:33 PMGasper Kojek
04/20/2022, 7:53 AMgradle.properties
and environment variables I can check, as well as command-line flags, but is there a way to print out all properties other than those, that might affect configuration cache? The output of ./gradlew properties
between runs differs in some hashes, could that be the cause? If so, what could be the reason for that, since gradle user home is saved and restored, as well as <project>/.gradle/configuration-cache
?Vampire
04/20/2022, 7:55 AMbuild/reports
as artifact, there all inputs should be listed. Then you should be able to compare it or see which might change.Gasper Kojek
04/20/2022, 8:01 AMThese sources, however, are not included in the configuration cache report.
Vampire
04/20/2022, 8:59 AMAs far as I understand, that is a report of storing the configuration cache, not using it.That's right, but if it does not reuse it for some reason and then stores another one, you should be able to compare the old one with the new one and see a difference. If there is no difference, it is probably in those mentioned cases that are not added to the report. So I guess indeed
The output ofis the cause if they come from one of the non-reported locations. But probably hard to guess without telling which hashes you mean.between runs differs in some hashes, could that be the cause./gradlew properties
Paul Merlin
04/20/2022, 12:15 PMPaul Merlin
04/20/2022, 12:15 PMGasper Kojek
04/20/2022, 12:23 PM./gradlew properties
-> if you do a compare you’ll see the differences. They are for instance the @hash
for these two lines:
ant: org.gradle.api.internal.project.DefaultAntBuilder@7ffd3d78
antBuilderFactory: org.gradle.api.internal.project.DefaultAntBuilderFactory@6c95d08f
I’ve checked, some environment variables also change on CI runs (github actions sets the run id, commit hash, etc. into env), but they aren’t mentioned in the config cache report.Paul Merlin
04/20/2022, 12:25 PM:properties
task uses Project.getProperties()
which include way too much things.Vampire
04/20/2022, 12:28 PMGasper Kojek
04/20/2022, 12:28 PMVampire
04/20/2022, 12:29 PMPaul Merlin
04/20/2022, 12:32 PMabstract class ReportLoadedGradleProperties : DefaultTask() {
@TaskAction
fun action() {
println(
services.get(org.gradle.initialization.GradlePropertiesController::class.java)
.gradleProperties
.mergeProperties(emptyMap())
.entries
.joinToString("\n")
)
}
}
tasks.register<ReportLoadedGradleProperties>("reportLoadedGradleProperties")
Gasper Kojek
04/20/2022, 1:36 PMsecrets.GITHUB_TOKEN
, which we need to authenticate to our internal maven repository. I guess there’s no way around not triggering CC since this is automatically generated by github for each run separately?
Edit: to be clear, we set it with -PmavenPassword
and retrieve with
credentials(PasswordCredentials::class)
Vampire
04/20/2022, 2:41 PMVampire
04/20/2022, 2:41 PMGasper Kojek
04/20/2022, 8:55 PM