Skip to content
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

Basic bzlmod setup #3047

Merged
merged 4 commits into from
Jul 1, 2022
Merged

Basic bzlmod setup #3047

merged 4 commits into from
Jul 1, 2022

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented Jan 17, 2022

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This PR adds a MODULE.bazel that makes rules_go usable as a bzlmod module for basic use cases.

The new module definition is verified by a test module that will be used in the presubmit tests of the Bazel Central Registry (BCR).

The following features require more thought and/or work and are not yet supported:

  • SDK rules other than go_host_sdk and go_download_sdk.
  • non-no-op nogo
  • go_proto_library

Which issues(s) does this PR fix?

Work towards #3020.

Other notes for review

Based on #3046, so please review that one first.

@fmeum fmeum force-pushed the basic-bzlmod branch 2 times, most recently from d3b5de8 to 35fc106 Compare January 17, 2022 11:02
@fmeum fmeum marked this pull request as ready for review January 17, 2022 11:18
@fmeum
Copy link
Member Author

fmeum commented Jan 17, 2022

This is essentially ready for review. The CI fails because the test machines have no Go installed and I chose to use the host SDK as the default toolchain for the new module. Of course we can change that to a hermetic toolchain and/or install Go in the CI.

@achew22 @robfig What is your take on this? Bazel modules are generally expected to be "batteries included" in the sense that they provide a reasonable default toolchain that can then be overriden by the user. In the case of Go, using the host SDK sounds reasonable and would also be in line with how C++ and Java behave with Bazel. However, that would require making a Go SDK available in the CI.

@fmeum
Copy link
Member Author

fmeum commented Jan 17, 2022

Sorry, I misunderstood the CI failure. Bazel of course has to load the repositories of each toolchain, even if it doesn't end up being selected, so the failure would occur for every user without a local Go SDK. I will look into making this a soft fail, but would already appreciate your feedback on the rest of the PR.

@fmeum
Copy link
Member Author

fmeum commented Jan 20, 2022

I have put some more thought into how toolchain selection could be improved with bzlmod. I will try to get some feedback on these in the bzlmod community before I continue here.

@ar3s3ru
Copy link

ar3s3ru commented Feb 24, 2022

Hey there @fmeum! Any updates on this PR?
Would be awesome to see rules_go support Bzlmod

@fmeum
Copy link
Member Author

fmeum commented Feb 24, 2022

I haven't continued working on it since rules_go without gazelle wouldn't be that useful and turning gazelle into a bzlmod module would most likely require more progress on bazelbuild/bazel#14590 and bazelbuild/bazel#14580. I will revisit this PR when things have improved.

@ar3s3ru
Copy link

ar3s3ru commented Feb 25, 2022

@fmeum is it really necessary to turn gazelle into a bzlmod module for this PR to be merged?
AFAIK the dependency is gazelle -> rules_go, not the other way around.

What I can see from the failing CI is that the code is expecting a toolchain to be installed in the host machine by default, but we could package a default toolchain instead and make it hermetic, no?

Can't gazelle be used still within WORKSPACE while these blocking issues are resolved?

@fmeum
Copy link
Member Author

fmeum commented May 4, 2022

@ar3s3ru It is not strictly necessary to turn gazelle into a bzlmod module - but without gazelle, rules_go probably wouldn't be that useful. In particular, go_proto_library wouldn't work without the supporting go repositories. While it would be possible to include these with the patched in BUILD files, the proper way to make this work would indeed be to bzlmodify gazelle, provide a go_repository-like module extension and let rules_go load these repositories in this way.

I would leave the decision to the maintainers whether having an incomplete version of rules_go as a bzlmod module is something they would see as a net positive (rather than just added complexity). If so, I could quickly fix up the PR and get it merged. @achew22 @linzhp What are your thoughts?

@achew22
Copy link
Member

achew22 commented May 4, 2022

Personally I agree with @fmeum. gazelle provides go_repository which is how third-party go code would be loaded into the build graph. I try VERY hard to not add any third-party dependencies on a project, but I'm not sure I've ever made it to production without one. rules_go is, sadly, not very useful without gazelle.

@achew22
Copy link
Member

achew22 commented Jun 7, 2022

I'm happy to merge this, but what is the story for 3p dependencies declared by rules_go consumers?

@fmeum
Copy link
Member Author

fmeum commented Jun 7, 2022

@achew22 My current plan is as follows:

  1. Get rules_go into the BCR based on this PR. The BCR is still in beta, so we can make changes at any time - there is no need to commit to an API yet.
  2. Work on a module extension provided by Gazelle that allows modules to declare their go.mod-style (no http/git/forks/... for starters) dependencies in a way that works well with transitive dependencies. I have a rough prototype of this.
  3. Use this module extension in rules_go (cyclic dependencies between modules are permitted) to get the Go modules required for protos to work. That will be the first real test case for these two modules.

After these basics have been found to work, we should start proper discussions on the APIs and features we want to support. I just think it's too early for extended design discussions until there is at least one ruleset handling transitive dependencies in the BCR - currently there are none.

@achew22
Copy link
Member

achew22 commented Jun 7, 2022

Are we dependent on bzlmod being experimental to note that we are going to make backward incompatible changes? Is there any way to put up some blinking hazard lights to notify anyone who may stumble into it that it's definitely not ready for prime time yet?

@fmeum
Copy link
Member Author

fmeum commented Jun 8, 2022

Are we dependent on bzlmod being experimental to note that we are going to make backward incompatible changes? Is there any way to put up some blinking hazard lights to notify anyone who may stumble into it that it's definitely not ready for prime time yet?

That's a good point. I added https://github.com/bazelbuild/rules_go/pull/3047/files#diff-6136fc12446089c3db7360e923203dd114b6a1466252e71667c6791c20fe6bdcR10. Is is scary enough? If so, you can merge, I will not make further changes.

With the repository mappings used by bzlmod, the
Label(...).workspace_name construct always returns the canonical,
post-repo mapping repo name, which can't be used to construct a valid
label. Until bazelbuild/bazel#15593 has been
fixed, we have to hardcode the non-canonical repo name here.
fmeum added 2 commits June 8, 2022 09:31
The existing repository macros can be reused for the module setup
with only very few fully backwards compatible changes:

* The macros wrapping the Go SDK repository rules should make toolchain
  registration optional. With bzlmod, toolchains are registered with the
  toolchains_to_register attribute of the module function instead.
* The repository macro should not use _maybe with bzlmod. Instead, repos
  loaded by module extensions are given globally unique internal names
  automatically.
@fmeum fmeum force-pushed the basic-bzlmod branch 2 times, most recently from 40b563a to a76fcc5 Compare June 8, 2022 11:12

bazel_dep(name = "io_bazel_rules_go", version = "", repo_name = "my_rules_go")
local_path_override(
module_name = "io_bazel_rules_go",
Copy link
Member

Choose a reason for hiding this comment

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

I thought it was going to show up in bzlmod as just rules_go?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will, but only via patches applied on top of this PR.

I initially tried to make rules_go completely repo name agnostic in a backwards compatible way, but that doesn't seem possible: There are a number of places that require absolute labels with Bazel 4 and other places (see below) where naive absolute labels don't work with bzlmod. I can try again after Bazel 5 has become the required minimum version.

IMO the best way forward will be to keep the number of io_bazel_rules_go mentions low enough that the patch that makes it available as rules_go in the BCR is easy to maintain. New users relying on modules get to choose their repo name freely, all others probably don't want to go through the hassles of renaming everything. When WORKSPACE has finally been deprecated, we can rename everything without and get rid of the patch.

What do you think?

MODULE.bazel Outdated Show resolved Hide resolved
bcr_tests/.bazelrc Outdated Show resolved Hide resolved
@@ -233,7 +237,7 @@ def _sdk_build_file(ctx, platform):
"{goos}": goos,
"{goarch}": goarch,
"{exe}": ".exe" if goos == "windows" else "",
"{rules_go_repo_name}": Label("//go/private:BUILD.sdk.bazel").workspace_name,
Copy link
Member

Choose a reason for hiding this comment

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

I think the logic behind this was that it would resolve to io_bazel_rules_go if you imported it as such, but if people started to import as rules_go they would get that. Does this force us to use io_bazel_rules_go going forward?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a pattern that currently breaks with bzlmod: With repo mappings, which it uses, the value of workspace_name will be the mapped repo name, which can't be used to form a valid label. This is where bazelbuild/bazel#15593 would help.

As a result, this line either needs to be replaced on master or via a patch in the BCR. I opted for the former as there are other blockers to a non-bzlmod repo name agnostic rules_go (see my other comment).

@fmeum fmeum force-pushed the basic-bzlmod branch 2 times, most recently from dc2cc96 to 22102bd Compare June 9, 2022 08:23
This commit adds a MODULE.bazel that makes rules_go usable as a bzlmod
module for basic use cases.

The new module definition is verified by a test module that will be used
in the presubmit tests of the Bazel Central Registry (BCR).

The following features require more thought and/or work and are not yet
supported:
* SDK rules other than go_host_sdk and go_download_sdk.
* non-no-op nogo
* go_proto_library
Copy link
Member

@achew22 achew22 left a comment

Choose a reason for hiding this comment

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

LGTM % 1

MODULE.bazel Show resolved Hide resolved
@fmeum fmeum merged commit e80bb2c into bazel-contrib:master Jul 1, 2022
@fmeum fmeum deleted the basic-bzlmod branch July 1, 2022 17:09
gcf-merge-on-green bot referenced this pull request in googleapis/gapic-generator-go Jul 19, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.33.0` -> `v0.34.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

### [`v0.34.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.34.0)

[Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.33.0...v0.34.0)

#### What's Changed

-   releaser: fix scrubbing timestamp from patch files by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3180](https://togithub.com/bazelbuild/rules_go/pull/3180)
-   Replace Starlark JSON parser with json.decode by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3184](https://togithub.com/bazelbuild/rules_go/pull/3184)
-   gopackagesdriver: separates "s" files in pkg info by [@&#8203;iamricard](https://togithub.com/iamricard) in [https://github.com/bazelbuild/rules_go/pull/3165](https://togithub.com/bazelbuild/rules_go/pull/3165)
-   Refactor away references to @&#8203;io_bazel_rules_go by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3185](https://togithub.com/bazelbuild/rules_go/pull/3185)
-   Do not print to stderr if cgo linking succeeds after retry by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3187](https://togithub.com/bazelbuild/rules_go/pull/3187)
-   Use param files with go-protoc by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3190](https://togithub.com/bazelbuild/rules_go/pull/3190)
-   Don't include non-executable go_binary in dependent's runfiles by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3151](https://togithub.com/bazelbuild/rules_go/pull/3151)
-   Link in native libraries of transitive dependencies in archive mode by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3186](https://togithub.com/bazelbuild/rules_go/pull/3186)
-   runfiles: remove deprecated api by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3198](https://togithub.com/bazelbuild/rules_go/pull/3198)
-   Fix failing open hermeticity test by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3206](https://togithub.com/bazelbuild/rules_go/pull/3206)
-   Fix go_googleapis Gazelle patch by [@&#8203;nickgooding](https://togithub.com/nickgooding) in [https://github.com/bazelbuild/rules_go/pull/3193](https://togithub.com/bazelbuild/rules_go/pull/3193)
-   Exclude unsupported C/C++ features by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3189](https://togithub.com/bazelbuild/rules_go/pull/3189)
-   Allow gomock to take Bazel common attributes by [@&#8203;linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3207](https://togithub.com/bazelbuild/rules_go/pull/3207)
-   Transition on edges not self by [@&#8203;illicitonion](https://togithub.com/illicitonion) in [https://github.com/bazelbuild/rules_go/pull/3116](https://togithub.com/bazelbuild/rules_go/pull/3116)
-   Include go_transition_test in bazel aspect by [@&#8203;ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) in [https://github.com/bazelbuild/rules_go/pull/3160](https://togithub.com/bazelbuild/rules_go/pull/3160)
-   Add an example for go_download_sdk.sdks by [@&#8203;fishy](https://togithub.com/fishy) in [https://github.com/bazelbuild/rules_go/pull/3139](https://togithub.com/bazelbuild/rules_go/pull/3139)
-   tests: nogo over generated code by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3214](https://togithub.com/bazelbuild/rules_go/pull/3214)
-   test nogo/coverage: test generated code by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3213](https://togithub.com/bazelbuild/rules_go/pull/3213)
-   Remove references to go_transition_test by [@&#8203;linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3215](https://togithub.com/bazelbuild/rules_go/pull/3215)
-   Basic bzlmod setup by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3047](https://togithub.com/bazelbuild/rules_go/pull/3047)
-   Run BCR tests against Bazel 6.0.0-pre.20220608.2 by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3223](https://togithub.com/bazelbuild/rules_go/pull/3223)
-   Use repo-relative labels in MODULE.bazel by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3226](https://togithub.com/bazelbuild/rules_go/pull/3226)
-   upkeep: upgrade to go 1.18.3 and gazelle v0.26.0 by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3220](https://togithub.com/bazelbuild/rules_go/pull/3220)
-   nogo: ignore generated source files by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3216](https://togithub.com/bazelbuild/rules_go/pull/3216)
-   asm: Pass package path with -p by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3231](https://togithub.com/bazelbuild/rules_go/pull/3231)
-   bzlmod: Add support for gomock by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3232](https://togithub.com/bazelbuild/rules_go/pull/3232)
-   test cgo: ensure helper script works by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3236](https://togithub.com/bazelbuild/rules_go/pull/3236)
-   Fix //tests/legacy/examples/cgo:cgo_lib_test on M1 Macs by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3237](https://togithub.com/bazelbuild/rules_go/pull/3237)
-   gopackagesdriver: Descend into go_proto_compiler's deps by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3240](https://togithub.com/bazelbuild/rules_go/pull/3240)
-   new_library: remove unused resolver by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3219](https://togithub.com/bazelbuild/rules_go/pull/3219)
-   nogo: instantiate type info for generic types when running under Go >=1.18 by [@&#8203;farhaven](https://togithub.com/farhaven) in [https://github.com/bazelbuild/rules_go/pull/3212](https://togithub.com/bazelbuild/rules_go/pull/3212)

#### New Contributors

-   [@&#8203;iamricard](https://togithub.com/iamricard) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3165](https://togithub.com/bazelbuild/rules_go/pull/3165)
-   [@&#8203;ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3160](https://togithub.com/bazelbuild/rules_go/pull/3160)
-   [@&#8203;fishy](https://togithub.com/fishy) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3139](https://togithub.com/bazelbuild/rules_go/pull/3139)
-   [@&#8203;farhaven](https://togithub.com/farhaven) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3212](https://togithub.com/bazelbuild/rules_go/pull/3212)

**Full Changelog**: bazel-contrib/rules_go@v0.33.0...v0.34.0

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
        ],
    )

    load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.18.4")

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-go).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjExNy40In0=-->
gcf-merge-on-green bot referenced this pull request in googleapis/gapic-config-validator Jul 19, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.33.0` -> `v0.34.0` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go</summary>

### [`v0.34.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.34.0)

[Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.33.0...v0.34.0)

#### What's Changed

-   releaser: fix scrubbing timestamp from patch files by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3180](https://togithub.com/bazelbuild/rules_go/pull/3180)
-   Replace Starlark JSON parser with json.decode by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3184](https://togithub.com/bazelbuild/rules_go/pull/3184)
-   gopackagesdriver: separates "s" files in pkg info by [@&#8203;iamricard](https://togithub.com/iamricard) in [https://github.com/bazelbuild/rules_go/pull/3165](https://togithub.com/bazelbuild/rules_go/pull/3165)
-   Refactor away references to @&#8203;io_bazel_rules_go by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3185](https://togithub.com/bazelbuild/rules_go/pull/3185)
-   Do not print to stderr if cgo linking succeeds after retry by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3187](https://togithub.com/bazelbuild/rules_go/pull/3187)
-   Use param files with go-protoc by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3190](https://togithub.com/bazelbuild/rules_go/pull/3190)
-   Don't include non-executable go_binary in dependent's runfiles by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3151](https://togithub.com/bazelbuild/rules_go/pull/3151)
-   Link in native libraries of transitive dependencies in archive mode by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3186](https://togithub.com/bazelbuild/rules_go/pull/3186)
-   runfiles: remove deprecated api by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3198](https://togithub.com/bazelbuild/rules_go/pull/3198)
-   Fix failing open hermeticity test by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3206](https://togithub.com/bazelbuild/rules_go/pull/3206)
-   Fix go_googleapis Gazelle patch by [@&#8203;nickgooding](https://togithub.com/nickgooding) in [https://github.com/bazelbuild/rules_go/pull/3193](https://togithub.com/bazelbuild/rules_go/pull/3193)
-   Exclude unsupported C/C++ features by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3189](https://togithub.com/bazelbuild/rules_go/pull/3189)
-   Allow gomock to take Bazel common attributes by [@&#8203;linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3207](https://togithub.com/bazelbuild/rules_go/pull/3207)
-   Transition on edges not self by [@&#8203;illicitonion](https://togithub.com/illicitonion) in [https://github.com/bazelbuild/rules_go/pull/3116](https://togithub.com/bazelbuild/rules_go/pull/3116)
-   Include go_transition_test in bazel aspect by [@&#8203;ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) in [https://github.com/bazelbuild/rules_go/pull/3160](https://togithub.com/bazelbuild/rules_go/pull/3160)
-   Add an example for go_download_sdk.sdks by [@&#8203;fishy](https://togithub.com/fishy) in [https://github.com/bazelbuild/rules_go/pull/3139](https://togithub.com/bazelbuild/rules_go/pull/3139)
-   tests: nogo over generated code by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3214](https://togithub.com/bazelbuild/rules_go/pull/3214)
-   test nogo/coverage: test generated code by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3213](https://togithub.com/bazelbuild/rules_go/pull/3213)
-   Remove references to go_transition_test by [@&#8203;linzhp](https://togithub.com/linzhp) in [https://github.com/bazelbuild/rules_go/pull/3215](https://togithub.com/bazelbuild/rules_go/pull/3215)
-   Basic bzlmod setup by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3047](https://togithub.com/bazelbuild/rules_go/pull/3047)
-   Run BCR tests against Bazel 6.0.0-pre.20220608.2 by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3223](https://togithub.com/bazelbuild/rules_go/pull/3223)
-   Use repo-relative labels in MODULE.bazel by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3226](https://togithub.com/bazelbuild/rules_go/pull/3226)
-   upkeep: upgrade to go 1.18.3 and gazelle v0.26.0 by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3220](https://togithub.com/bazelbuild/rules_go/pull/3220)
-   nogo: ignore generated source files by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3216](https://togithub.com/bazelbuild/rules_go/pull/3216)
-   asm: Pass package path with -p by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3231](https://togithub.com/bazelbuild/rules_go/pull/3231)
-   bzlmod: Add support for gomock by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3232](https://togithub.com/bazelbuild/rules_go/pull/3232)
-   test cgo: ensure helper script works by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3236](https://togithub.com/bazelbuild/rules_go/pull/3236)
-   Fix //tests/legacy/examples/cgo:cgo_lib_test on M1 Macs by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3237](https://togithub.com/bazelbuild/rules_go/pull/3237)
-   gopackagesdriver: Descend into go_proto_compiler's deps by [@&#8203;fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3240](https://togithub.com/bazelbuild/rules_go/pull/3240)
-   new_library: remove unused resolver by [@&#8203;sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3219](https://togithub.com/bazelbuild/rules_go/pull/3219)
-   nogo: instantiate type info for generic types when running under Go >=1.18 by [@&#8203;farhaven](https://togithub.com/farhaven) in [https://github.com/bazelbuild/rules_go/pull/3212](https://togithub.com/bazelbuild/rules_go/pull/3212)

#### New Contributors

-   [@&#8203;iamricard](https://togithub.com/iamricard) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3165](https://togithub.com/bazelbuild/rules_go/pull/3165)
-   [@&#8203;ian-h-chamberlain](https://togithub.com/ian-h-chamberlain) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3160](https://togithub.com/bazelbuild/rules_go/pull/3160)
-   [@&#8203;fishy](https://togithub.com/fishy) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3139](https://togithub.com/bazelbuild/rules_go/pull/3139)
-   [@&#8203;farhaven](https://togithub.com/farhaven) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3212](https://togithub.com/bazelbuild/rules_go/pull/3212)

**Full Changelog**: bazel-contrib/rules_go@v0.33.0...v0.34.0

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
        ],
    )

    load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.18.4")

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-config-validator).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTcuNCIsInVwZGF0ZWRJblZlciI6IjMyLjExNy40In0=-->
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.

3 participants