-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Maintain a separate lockfile for HEAD Bazel #21283
Conversation
The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit just checks in a lockfile for HEAD Bazel and removes that hack. This separate lockfile is updated by running `bazel run //src/test/tools/bzlmod:update_default_lock_file`. If it goes out of date, the distfile tests will complain.
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.
Looks good to me.
Just so that we have considered it: couldn't we maintain MODULE.bazel.lock.dist
as the output of a rule that consumes MODULE.bazel
and runs bazel mod deps
on it with Bazel built at HEAD? Then we wouldn't need to update it manually.
that was my first thought too, but the input to that rule is more than just |
This change has the downside that any MODULE.bazel file change will require the developer to update the dist lock file, which requires running
For the bootstrap build, we actually only need the Bazel module resolution to be updated to prevent accessing BCR, module extensions can just rerun. That's because 1) the maven repo is already overridden, 2) other required module extension generated repo already has repo cache in the distfile. Therefore, I think it's safe to generate the lockfile with a build rule without specifying all inputs. |
The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit generates a lockfile for HEAD Bazel on the fly and uses that for the distribution archive. This lockfile doesn't have any module extension content, since we only need to make sure that no network access happens during tests that use the distribution archive. See #21283 (comment) for more context.
Thanks for the tip! Sent #21302 instead. |
changes from PR #21302) The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit generates a lockfile for HEAD Bazel on the fly and uses that for the distribution archive. This lockfile doesn't have any module extension content, since we only need to make sure that no network access happens during tests that use the distribution archive. See #21283 (comment) for more context. Change-Id: I5266bd1caf2e4cc3d7d18cb8695af73488064ae1 Signed-off-by: Xudong Yang <[email protected]>
The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit generates a lockfile for HEAD Bazel on the fly and uses that for the distribution archive. This lockfile doesn't have any module extension content, since we only need to make sure that no network access happens during tests that use the distribution archive. See #21283 (comment) for more context. Closes #21302. PiperOrigin-RevId: 606731749 Change-Id: If1f2b23066428b199e646059c76fa44ecfd2044a
changes from PR #21302) The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit generates a lockfile for HEAD Bazel on the fly and uses that for the distribution archive. This lockfile doesn't have any module extension content, since we only need to make sure that no network access happens during tests that use the distribution archive. See #21283 (comment) for more context. Change-Id: I5266bd1caf2e4cc3d7d18cb8695af73488064ae1 Signed-off-by: Xudong Yang <[email protected]>
The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit generates a lockfile for HEAD Bazel on the fly and uses that for the distribution archive. This lockfile doesn't have any module extension content, since we only need to make sure that no network access happens during tests that use the distribution archive. See #21283 (comment) for more context. Closes #21302. PiperOrigin-RevId: 606731749 Change-Id: If1f2b23066428b199e646059c76fa44ecfd2044a
…21338) The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too. This commit generates a lockfile for HEAD Bazel on the fly and uses that for the distribution archive. This lockfile doesn't have any module extension content, since we only need to make sure that no network access happens during tests that use the distribution archive. See #21283 (comment) for more context. Closes #21302. --------- Signed-off-by: Xudong Yang <[email protected]>
Mark found out via bazelbuild#21283 that we should run the command `bazel run //src/test/tools/bzlmod:update_default_lock_file`
The MODULE.bazel.lock file we have in our source tree is generated by the version of Bazel specified in the .bazelversion file. We currently use this lockfile for our distribution archives, which means whenever we increment the lockfile version, we need to manually transform the checked-in lockfile to make it work with HEAD Bazel too.
This commit just checks in a lockfile for HEAD Bazel and removes that hack. This separate lockfile is updated by running
bazel run //src/test/tools/bzlmod:update_default_lock_file
. If it goes out of date, the distfile tests will complain.