Skip to content

Comments

Upgrade to Bazel 9.0.0 with bzlmod and Go 1.25#640

Open
philwo wants to merge 5 commits intobazelbuild:masterfrom
philwo:philwo-bumpbazel
Open

Upgrade to Bazel 9.0.0 with bzlmod and Go 1.25#640
philwo wants to merge 5 commits intobazelbuild:masterfrom
philwo:philwo-bumpbazel

Conversation

@philwo
Copy link
Member

@philwo philwo commented Feb 6, 2026

I migrated the project to Bazel 9.0.0 bzlmod, Go 1.25 and latest versions of our dependencies. Hopefully this makes future upgrades much easier...

A few target names of go_library rules changed due to the Gazelle upgrade, which I hope is not a problem - if anyone depends on them it should be trivial to update the references when upgrading to the latest version of the SDK.

I verified that the project builds successfully on my machine with Bazel and that Gazelle & bzlmod are happy with the state of things:

$ bazel clean --expunge
$ bazel run //:gazelle -- fix
$ bazel mod tidy
$ bazel build //...

In addition, building with go build ./... and running the tests with go test ./... also works fine for me. :) I fixed a few little things that became necessary after the upgrades:

  • go/pkg/client/client.go had a non-constant format string in call to status.Errorf, fixed by using status.Error instead.
  • REAPI got a few new methods in the CAS, which caused build failures in the CAS fakes. Fixed by marking those methods as unimplemented.
  • I updated the .bazelci/presubmit.yml to use Ubuntu 24.04 and Go 1.25.7 and merged all steps using go into a single job to reduce unnecessary duplicate downloads and setup time.

@philwo philwo requested review from Wyverald and ramymedhat February 7, 2026 06:29
@philwo
Copy link
Member Author

philwo commented Feb 7, 2026

@Wyverald Would you mind reviewing this PR to check whether the changes I made for migrating to bzlmod look good?

@ramymedhat Do you think this PR would be fine to merge here, or do we need to make any preparations to not break internal usage of it by reclient?

Thanks in advance to both of you 😊

I migrated the project to Bazel 9.0, bzlmod, Go 1.25 and latest versions
of our dependencies. Hopefully this makes future upgrades much easier.

A few target names of go_library rules changed due to the Gazelle
upgrade, which I hope is not a problem - if anyone depends on them it
should be trivial to update the references when upgrading to the latest
version of the SDK.

I verified that the project builds successfully on my machine with Bazel
and that Gazelle & bzlmod are happy with the state of things:

```bash
$ bazel clean --expunge
$ bazel run //:gazelle -- fix
$ bazel mod tidy
$ bazel build //...
```

In addition, building with `go build ./...` and running the tests with
`go test ./...` also works fine for me. :) I fixed a few little things
that became necessary after the upgrades:
- go/pkg/client/client.go had a non-constant format string in call to
  status.Errorf, fixed by using status.Error instead.
- REAPI got a few new methods in the CAS, which caused build failures
  in the CAS fakes. Fixed by marking those methods as unimplemented.
- I updated the .bazelci/presubmit.yml to use Ubuntu 24.04 and Go 1.25.7
  and merged all steps using `go` into a single job to reduce
  unnecessary duplicate downloads and setup time.

bazel_dep(name = "grpc", version = "1.76.0.bcr.1")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "protobuf", version = "33.5")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general comment: you can avoid a lot of the diffs in this PR by specifying repo_name in bazel_dep. For this one, you can do bazel_dep(name="protobuf", version="33.5", repo_name="com_google_protobuf"), and that would mean you don't need to update any occurrence of @com_google_protobuf//:foo to @protobuf//:foo. Same with rules_go, googleapis, etc. I'll leave it to the actual maintainers of this project to decide what they want to go with.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks! I personally would prefer to take the one-time pain of having the larger diff with the renames, but from then on we're using the "correct" original names from the BCR. But if other maintainers feel strongly about this, or it makes something easier for the import into our internal repo, we can also change it.

@philwo philwo requested review from bentekkie February 16, 2026 13:32
@philwo
Copy link
Member Author

philwo commented Feb 16, 2026

@bentekkie Could you help me out with a review of this one? The Bazel 9.0.0 PR for remote-apis was just merged, so if we get this one in, too, we'd have both repos fully modernized and up to date :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants