bazel: Migrate to bzlmod for dependency management #189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change aims to fix the
bazel build
postsubmit workflow in a somewhat heavy-handed way: by migrating to use bzlmod to manage dependencies, and by updating said dependencies (and the supported version of bazel itself) to the newest version(s) feasible.This involves:
WORKSPACE.bazel
, and adding equivalent dependency fetches toMODULE.bazel
. Each version used is the newest available on BCR, with the exception of:rules_proto
, which encounters a Starlark error with the latest version of7.0.2
protobuf
, which must match versions with the toolchain loaded bytoolchains_protoc
; the latest version oftoolchains_protoc
does not have a Starlark mapping for protobuf v29.0 yet.cc_grpc_library
(provided by gRPC) tocpp_grpc_library
(provided byrules_proto_grpc_cpp
), which seems to be the current canonical ruleset for this. These rules generate proto, grpc, and mock bindings by default, so the corresponding attributes are dropped since they're no longer necessary.gnmi_deps.bzl
, as it is no longer used to fetch dependencies, and can only confuse downstream users that also load this file.Additionally, there are some quality-of-life changes:
.bazelversion
is added to pin the version of bazel used when invoked viabazelisk
.gitignore
is added to avoid committing bazel-generated symlinksTested:
bazel build //...
works on my system (Linux, amd64)There are good reasons not to take this change, including:
...and this change author has little context on the presence/severity of these issues - guidance here would be welcome!