Daemon vs. CI Environment

In the current docs, it’s specifically stated that the Gradle daemon should not be used in a CI environment. I know this was the case when it was in experimental mode, but is that still the best practice? Or, with the maturity of the daemon is it now safe to use it in a CI environment?

We still recommend not using the daemon in CI. For reproducibility it’s just safer to use a clean build environment for each CI build, plus the benefits just aren’t as great for CI as in a developer workflow.

And just so it’s clear, Mark, isn’t it the case that this recommendation
has nothing to do with any notion that the daemon is “experimental”, or
early in its development? I believe it’s the case that this limitation (if
you can call it that) is inherent in the design of the daemon.

Correct, the daemon is not considered experimental. The caching strategies used in the daemon primarily benefit development builds where you want the best possible response time for builds. Meaning shaving a few seconds off of the CI build probably isn’t a big deal but is for a developer running many builds a day. For that reason we primarily prioritize stability in CI builds over speed. Running builds in a completely clean and isolated build environment is the best way to accomplish this. Check out the user guide for more info.