Skip to content

deps(gazelle): Bump rules_go from 0.41.0 to 0.55.0; gazelle from 0.31.0 (or 0.33.0 for bzlmod) to 0.40.0; go from 1.19.4 to 1.22.0 #2962

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dougthor42
Copy link
Collaborator

@dougthor42 dougthor42 commented Jun 6, 2025

Bump versions:

  • rules_go from 0.41.0 to 0.55.0
  • gazelle from 0.31.0 (or 0.33.0 for bzlmod) to 0.40.0
  • go from 1.19.4 to 1.22.0

Fixes #2956.

  • Run go get github.com/bazelbuild/[email protected] for version bump.
  • Run go mod tidy to clean up stale deps
  • Run bazel run //:gazelle_update_repos
  • Figure out http_archive hashes and apply them for WORKSPACE users.
  • Also bump bazel-gazelle to address a warning:
    • go get github.com/bazelbuild/[email protected]
    • Mismatch between versions requested for module
      github.com/bazelbuild/bazel-gazelle
      Bazel dependency version requested in MODULE.bazel: 0.40.0
      Go module version requested in go.mod: 0.31.1
      Please resolve this mismatch to prevent discrepancies between
      native Go and Bazel builds

  • Update CHANGELOG.md accordingly

Bump `rules_go` from 0.41.0 to 0.55.0

Fixes bazel-contrib#2956.

+ Run `go get github.com/bazelbuild/[email protected]` for version bump.
+ Run `go mod tidy` to clean up stale deps
+ Run `bazel run //:gazelle_update_repos`
+ Figure out http_archive hashes and apply them for WORKSPACE users.
+ Also bump bazel-gazelle to address a warning:
    + `go get github.com/bazelbuild/[email protected]`
    + > Mismatch between versions requested for module
      > github.com/bazelbuild/bazel-gazelle
      > Bazel dependency version requested in MODULE.bazel: 0.40.0
      > Go module version requested in go.mod: 0.31.1
      > Please resolve this mismatch to prevent discrepancies between
      > native Go and Bazel builds
+ Update CHANGELOG.md accordingly
@dougthor42
Copy link
Collaborator Author

I'm not exactly sure how to fix the failing WORKSPACE tests.

(23:42:51) ERROR: no such package '@@org_golang_x_tools//go/vcs': BUILD file not found
in directory 'go/vcs' of external repository @@org_golang_x_tools. Add a BUILD file
to a directory to mark it as a package.
(23:42:51) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/d2393494a560f9893c8389cd6840bb63/external/bazel_gazelle/repo/BUILD.bazel:3:11: no
such package '@@org_golang_x_tools//go/vcs': BUILD file not found in directory 'go/vcs'
of external repository @@org_golang_x_tools. Add a BUILD file to a directory to mark it
as a package. and referenced by '@@bazel_gazelle//repo:repo'

My assumption is that there's an issue with this go_repository being a nested module, and that go_repository is running gazelle on the root org_golang_x_tools instead.

go_repository(
    name = "org_golang_x_tools_go_vcs",
    importpath = "golang.org/x/tools/go/vcs",
    sum = "h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4=",
    version = "v0.1.0-deprecated",
)

Any thoughts? I thought that maybe some build_directives could help here, but I didn't see any obvious ones. Maybe gazelle:prefix?

Thus far I'm unable to reproduce the issue locally, so fixing it might result in some CI spam...

@dougthor42
Copy link
Collaborator Author

Thus far I'm unable to reproduce the issue locally

Reproduced via the very simple bazel test --noenable_bzlmod --enable_workspace //... from the gazelle directory 🤦.

Investigating a fix.

@dougthor42 dougthor42 changed the title deps(gazelle): Bump rules_go from 0.41.0 to 0.55.0 deps(gazelle): Bump rules_go from 0.41.0 to 0.55.0; gazelle from 0.31.0 (or 0.33.0 for bzlmod) to 0.40.0; go from 1.19.4 to 1.22.0 Jun 9, 2025
@dougthor42
Copy link
Collaborator Author

@aignas I've solved the WORKSPACE stuff by bumping gazelle to 0.40.0, and in doing so had to bump go from 1.19.4 to 1.22.0. This go bump looks like it may have broken some BuildKite stuff? @@bazel_gazelle_is_bazel_module//:defs.bzl.

Example:

(03:46:18) ERROR: error loading package '@@rules_python_gazelle_plugin//': at /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/bazel_gazelle/def.bzl:16:5: Unable to find package for @@bazel_gazelle_is_bazel_module//:defs.bzl: The repository '@@bazel_gazelle_is_bazel_module' could not be resolved: Repository '@@bazel_gazelle_is_bazel_module' is not defined.
(03:46:18) ERROR: /workdir/BUILD.bazel:36:10: error loading package '@@rules_python_gazelle_plugin//': at /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/external/bazel_gazelle/def.bzl:16:5: Unable to find package for @@bazel_gazelle_is_bazel_module//:defs.bzl: The repository '@@bazel_gazelle_is_bazel_module' could not be resolved: Repository '@@bazel_gazelle_is_bazel_module' is not defined. and referenced by '//:distribution'

Can you take a look?

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.

chore: update to rules_go v0.55.0
2 participants