Hi :wave: I'm trying to reuse Gradle remote cache ...
# caching
k
Hi 👋 I'm trying to reuse Gradle remote cache across different clients but facing an issue that most of all build cache key are different between remote machine and locale machine. I'm able to see what Value properties are different between remote and local in Develocity. But can't confirm the actual value inside of the value property. Is there any way to confirm what value is inside? This making me so difficult to debug.
1
For example, these 2 value properties are different but I can’t check actual value
v
For File properties you can display the differences. I guess for value properties you either have to use a custom value to get it to the build scan or simply print it to the console and compare manually.
k
Got it, so there is no way to confirm without additional setup. I will try to print it to console
v
Not sure, but I'm not aware of any
i
you can use custom values to add the value properties of the KotlinCompile task
v
Yes, that's what I said. 🙂 Either adding as custom values or printing out and comparing manually. The question was out-of-the-box in the already existing build scans. 😉
i
If you don't want to add the additional step—and since the two property differences are related to the JVM version in the Kotlin compiler—you could explore the task timeline to review the Java toolchain used for the Kotlin compiler task
k
Thank you! I was able to align those value differences by fixing java toolchain version. Then, I’m stuck about this
extractedJdkImage
property. Does it means each machines need to use exactly same JVM image (not only Java version but also vender etc)?
t
IIRC vendor is part of the key, but version is only about the major.
n
You need to look at what the differences are in that folder and then potentially use runtime classpath normalization to normalize the differences.
k
Does Gradle provide better document about what is classpath normalization? Even after read the linked document, I have no idea what does it means 😓
n
What was the difference in the comparison? I can help you adjust the runtimeclasspath as needed if you let me know what the difference was.
k
Here is a different 1st: local, 2nd: remote
n
I can't really tell from the picture what is different. Can you help me out?
Btw, since you are a Develocity customer you should also reach out to them as they are trained to help you with this.
k
I can’t really tell from the picture what is different. Can you help me out?
Actually, the
extracted
is just a directly and the content of the directory is what I posted above. I’m also not sure why Gradle reposting it as differences..
n
It is likely that the contents of some of files are different. Have you compared the contents of the files?
k
since you are a Develocity customer you should also reach out to them as they are trained to help you with this.
Right, I’m a kind bit far from the team mainly contacting with the Develocity team so I tried to get help here at first. But I will probably reach out the Develocity team since my issue seems complicated
n
no worries. I will reach out for you. 🙂 @Clay Johnson can you help here?
🙏 1
k
> Have you compared the contents of the files? Not yet, there are 1748 files in the directory so it’s kind impossible to check 😓
n
you can use the
diff
command line tool to easily compare two directories
example:
diff <dir1> <dir2>
👀 1
k
Thank you, I ran the command. Here is a result
n
wow, seems like almost everything is different. i wonder if it is the line endings. can you compare just
HpkeSpi.class
and let me know what the difference is between the two?
c
Hi Kentaro, I sent you a DM 👍
👍 1
🙆‍♂️ 1
k
> can you compare just
HpkeSpi.class
and let me know what the difference is between the two? The binary content itself is different. I attached those files for reference
a
Untitled
Seems the other one has
@FlaggedApi
annotations
👋 I’m working with Ken on this. 🙇
👋 1
👍 1
j
Afaik the
FlaggedApi
annotation was removed in Android platform tools v35.0.2 Could you align the platform tools version (up to the revision) and confirm that the diff is no longer present?
k
It seems v35.0.2 has not been published yet?
Copy code
bin % ./sdkmanager --install "build-tools;35.0.2"
Warning: Failed to find package 'build-tools;35.0.2'
Oh, you meant platform-tools not build-tools. Right, now the file inconsistent seems resolved, thank you so much!!
👍 1
🙌 1
👌 1
j
Excellent, thanks for the confirmation 👍