How do we disable cache for artifact transform? or...
# caching
d
How do we disable cache for artifact transform? org.jetbrains.kotlin.gradle.internal.transforms.ClasspathEntrySnapshotTransform It seems not worth to cache that task
a
Not possible at the moment
d
will be possible in the future?
a
Good question. We will add some internal properties for testing purposes in Gradle 8.9, see https://github.com/gradle/gradle/pull/28827, but these are just internal. We might change/remove it in the future. For this particular case, if it's not worth caching it should be fixed in Kotlin Gradle Plugin.
Basically we see there is a usecase for that, but in general it should be fixed by plugin. We don't want users to manage dozens of flags to get best performance
d
i see so it depends on plugin owner wether they want to allow us to disable/enable cache. just too many cache operation on my release build, because using minSDK 23 https://issuetracker.google.com/issues/169266011 most of them minus on avoidance saving
https://github.com/gradle/gradle/pull/28827 by the way in gradle 8.9 i will able to use this flag as well ?
a
Yeah, but it's internal as I said. So don't rely on it 🙂
d
ah okay, hopefully it goes public someday 😅 . im wondering how it will impact my build after enable/disable cache on transform.
is there anything i can do to mitigate this issue? I just review again my remote build cache size, on daily it push around 51gb of cache on single project. Our remote cache size only 80gb, so most likely it only store cache past 2 days. I also benchmarking performance when caching disabled using --rerun-tasks, and it is way faster which takes around 10 minutes to complete. When build cache enabled, it can be around 20 mins when cache rate low, but when cache rate hi it can be only 5 mins. especially on our release build, not make sense to have 1.2gb for storing/downloading artifact on each build.
a
About KGP issue: I don't think you can do anything other than disable build cache entirely. For whole build caching of your project: 51GB sounds like a lot of data. So I would first check that you are not storing jars or any big files to build cache. Normally it's not worth using build cache for big items, since download time for such items is normally higher than time to rebuild them locally.
d
I can see jar also stored, from 3rd party library. 51gb is my daily volume for remote cache, for each build it is around 1.2gb as screenshot above.