Is there any glaring reason as to why gradle cache...
# community-support
c
Is there any glaring reason as to why gradle cache is disabled by default? Seems like every project would benefit from it (just like gradle daemon)... no?
a
Maybe this gives some more context: https://github.com/gradle/gradle/issues/33903
🙏 2
v
As far as I remember, the reason was also that builds could easily break or silently misbehave. The build cache only works properly if the inputs and outputs of cacheable tasks are declared properly. But any build can add or change the task actions and so add new inputs or outputs that are not declared properly. This of course is a build bug and should better be fixed and would also affect up-to-date checks. But if for example someone brought over the bad habit from Maven to always use
clean
, his build might behave as expected as the tasks are always out of date anyway. If now build cache is suddenly enabled by default, his build will immediately be much faster as at least the cacheable tasks are reused from cache, but it will also start to misbehave as wrong cache entries will be reused and those errors might will be silent ones that only fail on production and can cost quite some time to figure out.
a
As far as I remember, the reason was also that builds could easily break or silently misbehave. The build cache only works properly if the inputs and outputs of cacheable tasks are declared properly.
That is a good point, I will add it to the issue
👌 1