Replies: 4 comments 2 replies
-
|
Bazel recommendations is to put it in version control https://bazel.build/versions/7.2.0/external/lockfile#best-practices Personally I think it is silly, and my personal projects don't do that: I don't check in the *.lock file and I have it in the .gitignore. Given that the BCR never allows to change existing projects but modifications are new *.bcr.$N versions, I can't really think of a situation in which the dependencies are secretly changing. So there is absolutely no benefit that I can see, just the pain of updating this thing for no good reason... |
Beta Was this translation helpful? Give feedback.
-
|
I would rather ignore it as well. @QuantamHD or @mikesinouye opinion? |
Beta Was this translation helpful? Give feedback.
-
|
fwiw I asked claude if the OR dependencies are tightly pinned: |
Beta Was this translation helpful? Give feedback.
-
|
@oharboe do you have such an action OR could copy? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@hzeller @QuantamHD @oharboe
Updating the bazel lock file is annoyingly serial. Claude suggests either
Don't commit the lockfile (simplest)
Add MODULE.bazel.lock to .gitignore and let each developer (and CI) regenerate it locally. This is what many Bazel projects do. The tradeoff is you lose hermetic reproducibility of the dependency resolution step — but in practice, if your MODULE.bazel pins versions tightly (which it should), the lockfile doesn't add much safety. You can run bazel mod deps --lockfile_mode=update in CI to regenerate it.
Regenerate it in CI via a merge bot
Keep the lockfile committed but don't let humans touch it. Set up automation (GitHub Action, post-merge hook) that runs bazel mod deps --lockfile_mode=update, commits the result, and pushes. PRs that touch MODULE.bazel trigger the regen; PRs that don't, don't touch the lockfile at all. This eliminates serialization since only one bot writes to the file.
What is the Google best practice in this area?
Beta Was this translation helpful? Give feedback.
All reactions