-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration cache is unusable in large projects when running ./gradlew projectHealth
#1098
Comments
There's a viewer for the configuration cache data: https://github.com/gradle/gcc2speedscope, which may give some insights into what is being stored. @TimvdLippe could you please try that? |
I will need security approval to run such tooling, so it will take me a couple of days to do so, but will do 👍 Is there a workaround to disable the configuration cache for the task anyways? I think we can mark it as incompatible ourselves, as we are an outlier in terms of codebase size and then we can wait for a potential fix. |
There's Task.notCompatibleWithConfigurationCache, you can look how Gradle itself uses it for a similar purpose. This should be enough to at least prevent loading the cache. I'm not sure if it also disables storing the graph (Gradle still checks for CC errors coming from other tasks), but that's the best option I know of. |
I was able to clone the project and build it. Unfortunately I am running into runtime issues with a |
All right. The failures were related to some internal changes I had to make. Fortunately I was able to run with the assistance of a colleague. Some data:
With an eyeball look (since we have loads and loads of modules), I was able to see that some tasks stood out:
Other tasks are also large, but at least from a first glance |
Looking at the PR in question, I wonder why we annotated Example from our internal plugin that afaik doesn't have the same configuration cache size hit: @Classpath
public abstract ConfigurableFileCollection getSourcesClasspath(); |
@mlopatkin Is that sufficient information for you or do you want me to run anything else? |
To unblock our upgrade, we will mark the |
This is the workaround I used if anybody else runs into this issue: import com.autonomousapps.tasks.GraphViewTask
project.getPluginManager().withPlugin('com.autonomousapps.dependency-analysis', { plugin ->
project.getTasks().withType(GraphViewTask).configureEach {
it.notCompatibleWithConfigurationCache("https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/1098")
}
} |
Build scan link
Internal scan unfortunately
Plugin version
Latest master (1.28.0)
Gradle version
8.6
JDK version
17
Describe the bug
When trying to integrate the latest version of the dependency analysis plugin into our codebase, we observed super slow configuration phases with Gradle. I ran
./gradlew projectHealth
on my laptop and this is the result:Before, the largest configuration cache side I had on my machine was 24MB. Gradle spent about 2 minutes in the "Storing configuration cache state" and then proceeded to run for 20 minutes in "Loading configuration cache state" after which I killed the process as I didn't expect it to finish.
Unfortunately the caches themselves are
.bin
files, so I can't give you anymore information of which particular part of the cache is large. I also suspect the size of the configuration cache correlates with the number of Java files, as we configure them in file collections.To Reproduce
Steps to reproduce the behavior:
./gradlew projectHealth
Expected behavior
The configuration cache for a run that includes
projectHealth
is within reasonable bounds compared to other tasks. In our case, we expect the cache to be smaller than 30 MB. It also should not cause the configuration cache storing and loading to take minutes for large builds. For a smaller build of ours, it still took 6 seconds to load the full configuration cache, where the entry is 211MB (about 1/4th of all modules included in this build, but typically excludes the largest ones we have).CC @cobexer and @ljacomet who contributed the configuration cache fixes in #1039
The text was updated successfully, but these errors were encountered: