Hi, I'm having a similar issue to a previous threa...
# gradle
c
Hi, I'm having a similar issue to a previous thread (https://kotlinlang.slack.com/archives/C19FD9681/p1631053467107200). Our CI is Linux and local is Mac. We recently updated to Gradle 8.0 and AGP 8.0 and we're seeing a lot of remote cache misses, but in our Gradle scan we only see 2 task differences. We have a setup with an included build of
build-logic
and the rest is our Android app project. Things I've already tried: 1. Ensured the same Java runtime between both environments 2. Set the java toolchain in our build-logic project 3. Ran the fingerprinting task that Nelson suggested. The diff is here: https://gist.github.com/changusmc/b4f39b61a161d99a484dee0eb82da729/revisions?diff=split
t
Gradle 8 now always provides a toolchain and by default it is the JDK Gradle is running on. You need to specify toolchain in
:buildLogic:convention
project
c
on my point #2 above, I have set the toolchain using
Copy code
kotlin {
    jvmToolchain {
        languageVersion = JavaLanguageVersion.of(17)
        vendor = JvmVendorSpec.AZUL
    }
}
Java toolchains compiler and runtime in the build scan for the
:build-logic:convention:compileKotlin
task: • Local:
Azul Zulu 17.0.6+10-LTS (aarch64)
• CI:
Azul Zulu 17.0.6+10-LTS (amd64)
t
hm, could you share build scan?
c
it's in our internal environment
it's weird if you look at the link in my point #3, the hashes for the jars are different between CI and local
For example,
t
it is hard to tell without seeing actual project configuration. Try locally with the exact same configuration as on CI (except OS) and check if there is still difference
c
can you expand on configuration? Do you mean how the project is structured?
t
yeah - structure + build scripts + how are you running it on CI
c
the command we use to populate the caches in CI is very close to our local commands, but I'll double check again. Our project structure is the same locally and in CI
hmm so based on a hunch, I deleted my 3rd party dep caches in
~/.gradle/caches/modules-2
and now i'm not getting a cache miss for
build-logic:convention:compileKotlin
I got 73% remote cache hits now