[Bazel CI] Fix: Update MODULE.bazel.lock file to support latest Bazel version
CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4075#01917d6d-0272-46ce-8094-fea6e559eede
Platform: Ubuntu
Logs:
ERROR: [0mThe version of MODULE.bazel.lock is not supported by this version of Bazel. Please run `bazel mod deps --lockfile_mode=update` to update your lockfile.
CC Greenteam @wyverald
Well, that was fast. :joy:
Is there any trick to have a lock file that is compatible with both 7.x and head?
If not, then we'll have to remove --lockfile=error from the bzlmod example and figure out another way to test.
cc @aignas
I think for the latest bazel version runs we could just use --lockfile_mode=update. Is it possible to configure something like this?
I looked through the CI docs, but nothing looked promising.
bazelrc files can't do version detection, so we can't do it that way.
Could we modify the CI config to run a bit of shell before the example runs? e.g. [[ <if bazel head> ]] echo "--lockfileupdate >> .bazelrc" ?
Otherwise, the two options i can think of are:
- Separate CI job. Set the skip_in_downstream_baze:true setting
- Bazel-in-bazel integration test
I think for now just skipping the examples/bzlmod would be cleanest, however, I realised that we are using this example in publishing the module to BCR, so the current situation is not great. I'll change the .bazelrc to --update as a quickfix, because I think having --lockfile_mode=error is more painful for the time being.