-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Make MODULE.bazel.lock deterministic
#19339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b6ab7f7 to
017112c
Compare
src/main/java/com/google/devtools/build/lib/bazel/bzlmod/BazelLockFileModule.java
Outdated
Show resolved
Hide resolved
Sorts the extensions, which would otherwise be added in the non-deterministic order in which module extension resolution events are fired, by their ID.
017112c to
b04a445
Compare
meteorcloudy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: is there any simple way to test this?
While not a dedicated test for this purpose, #19343 generates a lockfile twice and compares the outcomes. We could have an additional test with more extensions, but it may still not fail reliably in the face of actual non-determinism. |
|
OK, I'm fine with the test in #19343 |
|
@bazel-io flag |
|
@SalmaSamy Just saw that Git authorship wasn't preserved for the commit. Not a big deal, but maybe the way this was merged internally needs to be adjusted for future commits? |
|
Yes, we should not push the update mater branch by merge button for normal PRs. |
|
@bazel-io fork 6.4.0 |
Sorts the extensions, which would otherwise be added in the non-deterministic order in which module extension resolution events are fired, by their ID. Since Gson doesn't support custom comparators on a `TreeMap`, `ModuleExtensionId` now implements `Comparable` directly. Closes bazelbuild#19339. PiperOrigin-RevId: 560959804 Change-Id: Ic5579c032e6cd32fe4bd2114378812c0110109c2
Sorts the extensions, which would otherwise be added in the non-deterministic order in which module extension resolution events are fired, by their ID. Since Gson doesn't support custom comparators on a `TreeMap`, `ModuleExtensionId` now implements `Comparable` directly. Closes bazelbuild#19339. PiperOrigin-RevId: 560959804 Change-Id: Ic5579c032e6cd32fe4bd2114378812c0110109c2
Sorts the extensions, which would otherwise be added in the non-deterministic order in which module extension resolution events are fired, by their ID. Since Gson doesn't support custom comparators on a `TreeMap`, `ModuleExtensionId` now implements `Comparable` directly. Closes #19339. Commit ede4d49 PiperOrigin-RevId: 560959804 Change-Id: Ic5579c032e6cd32fe4bd2114378812c0110109c2 Co-authored-by: Fabian Meumertzheim <[email protected]>
|
The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc. |
Sorts the extensions, which would otherwise be added in the non-deterministic order in which module extension resolution events are fired, by their ID.
Since Gson doesn't support custom comparators on a
TreeMap,ModuleExtensionIdnow implementsComparabledirectly.