Hello! :wave: In my project we have a few include...
# community-support
r
Hello! 👋 In my project we have a few included builds and I just noticed this warning in a Develocity scan:
The build cache configuration of the root build differs from the build cache configuration of the early evaluated ':projectA', ':projectB' included builds. It is recommended to keep them consistent, see here.
That documentations says:
Such included builds will inherit the build cache configuration from the top level build, regardless of whether the included builds define build cache configuration themselves or not. The build cache configuration present for any included build is effectively ignored, in favour of the top level build’s configuration.
I have no specific build cache configuration on such included build modules, so I am actually expecting to inherit the build cache config from my root build. If the build cache configuration on the included builds is going to be ignored and inherit whatever is in the root build... what is the purpose of such warning? 🤔 I would understand it if I had some specific build cache config that conflicts with the root. But does it make sense to flag this when there is nothing defined in the included builds? Thanks!
v
I guess that would be up to be discussed with Gradle folks. But actually "not having configuration" is not really true, you just don't have explicit configuration and thus the default. So the settings you inherit from the parent build are different from the ones on the included build. If you always run the build as included build in that parent build only, there is probably no real point in the warning. But if you run the build included in different parent builds or also stand-alone, the results could theoretically differ. I guess that is why the warning is displayed. Actually as far as I can tell, this warning is also exclusively produced by the Develocity plugin. I cannot find this message anywhere in the Gradle sources and it is not shown on the commandline, only in the Build Scan.
Ah, no, I think the key is the "early evaluated". Are
projectA
and
projectB
plugin builds? They are evaluate before the settings script executed as they could contribute settings plugins, so they would not inherit the root builds cache configuration due to being "evaluated early". So in that case, the warning seems to be fully appropriate.
r
Yes, these are plugin builds. I didn't know they are managed differently (maybe something to update in that documentation linked by the error...). Thanks, this clarifies the mystery! Unfortunately we are declaring a plugin in one of these included builds with all the remote cache and develocity configuration, so this means that to solve this we would probably need to duplicate the remote cache config in these...
v
Well, common sense should already tell you actually if you think about the chicken-and-egg situation. :-) You need the plugin to set the configuration. To use the plugin you need to build it. To build it you expect to have the cache config inherited. But to inherit the config your have to set it. But to set it your need the plugin. ... If you publish your plugin, you can apply an earlier version of it to the plugin build to dog-feed it. If not, you probably have to duplicate the config for the build building that plugin. The other one can also include that build and use it. Regarding the documentation, just scroll down two paragraphs in the doc you linked to from the section you quoted. Read the "Note" admonition. :-)
🤦 1
r
true, somehow my brain ignored the "note" 😅
👌 1