palantir/gradle-consistent-versions

Inconsistencies in versions.lock file after running --write-locks across different machines

JoshSauter opened this issue · 3 comments

TL;DR: Several of us are working off of the same versions.props file but getting different versions.lock results from running --write-locks

What happened?

When pulling fresh from our master branch (which builds fine on our CI machines), running ./gradlew --write-locks generates a diff for me:

$ ፧ git diff
diff --git a/versions.lock b/versions.lock
index b328cbf..080e267 100644
--- a/versions.lock
+++ b/versions.lock
...
-org.codehaus.jackson:jackson-core-asl:1.9.13 (8 constraints: bd6f3cd0)
+org.codehaus.jackson:jackson-core-asl:1.9.13 (9 constraints: e37e2c84)
...
-org.codehaus.jackson:jackson-mapper-asl:1.9.13 (8 constraints: 1f6c7f7a)
+org.codehaus.jackson:jackson-mapper-asl:1.9.13 (9 constraints: 457b3292)
...

Another teammate running the same command on his local machine results in a different diff where only the hash values of several constraints have changed, and yet another teammate doing the same thing generates no diff from master at all.

What did you want to happen?

I would expect, given the same versions.props file, running ./gradlew --write-locks should generate the same versions.lock file regardless of incidental environmental differences between different machines. Is there some known cause for why we are experiencing this behavior?

Experiencing the same issue where plugin generates different versions.lock files on github ci (linux x86) and locally (macos aarch64)
Screenshot 2023-09-19 at 21 43 39

solved this issue by removing mavenLocal repository

We have been able to address this by purging the local maven cache when it occurs. So it appears to be due to corruption of the local cache.