Skip to content

Releases: bazel-contrib/rules_go

v0.45.1

19 Jan 14:58
7eadd85
Compare
Choose a tag to compare

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.21.6")

What's Changed

  • Disable layering_check feature in CGo tests by @fmeum in #3829
  • Print stack traces without panicking on test timeout by @fmeum in #3833
  • Fix regression in empty .go file filtering for nogo by @fmeum in #3832
  • release patch version 0.45.1 by @tyler-french in #3836

Full Changelog: v0.45.0...v0.45.1

v0.45.0

12 Jan 19:59
e2f0ae6
Compare
Choose a tag to compare

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.21.6")

What's Changed

  • nogo: use original source files instead of coverage-instrumented by @emmaxy in #3770
  • Allow compilers to be overwritten in go_grpc_library() by @mering in #3812
  • update documentation for 0.44 by @tyler-french in #3813
  • Temporarily undo deprecation of //proto:go_grpc by @fmeum in #3818
  • Rename bazel_features polyfill to prevent conflicts by @fmeum in #3817
  • Handle prerelease versions in polyfill by @illicitonion in #3821
  • Extend gomock to allow passing an source_importpath instead of library when operating in source mode by @therve in #3822
  • Fix coverage collection with modified COVERAGE_DIR env variable by @fmeum in #3820
  • improving logging for subcommand failure by @linzhp in #3824
  • release rules go 0.45.0 by @tyler-french in #3825

New Contributors

Full Changelog: v0.44.2...v0.45.0

v0.44.2

03 Jan 19:42
cea5f9f
Compare
Choose a tag to compare

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.21.5")

What's Changed

Full Changelog: v0.44.1...v0.44.2

v0.44.1

29 Dec 22:06
0a6311c
Compare
Choose a tag to compare

Why a patch release

This patch release is to include 43c40a9 which reverts a change to forcefully upgrade genproto transitively, which is causing linker failures since google.golang.org/genproto/googleapis/rpc was separated from google.golang.org/genproto

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.21.5")

What's Changed

Full Changelog: v0.44.0...v0.44.1

v0.44.0

19 Dec 19:47
d926d77
Compare
Choose a tag to compare

IMPORTANT CHANGES

Tests now call panic() when they timeout

This means there is a running goroutine (which will fail goleak detection)

[Goroutine 26 in state chan receive, with github.com/bazelbuild/rules_go/go/tools/bzltestutil.RegisterTimeoutHandler.func1 on top of the

This also means there may be some different behavior when calling SIGTERM directly from within a test.

For more information see: #3749

Bzlmod support for nogo

This can be added in your MODULE.bazel file:

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
    name = "go_sdk",
    ...
)
go_sdk.nogo(
    nogo = "//:default_nogo",
)

For more information see #3782

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.21.5")

What's Changed

New Contributors

Full Changelog: v0.43.0...v0.44.0

v0.43.0

20 Nov 17:13
cb279cd
Compare
Choose a tag to compare

Breaking x/tools upgrade

This change includes a breaking upgrade to golang.org/x/tools

Please make sure to upgrade x/tools to version v0.15.0 to ensure compatibility with rules_go's NoGo.

If you need to use an older version of x/tools (v0.13.0 or earlier), apply the following patch to rules_go:
x-tools.patch

What's Changed

New Contributors

Full Changelog: v0.42.0...v0.43.0

v0.42.0

27 Sep 23:14
c2406b2
Compare
Choose a tag to compare

What's Changed

Added patches to go_download_sdk:

Patches can now be applied to the standard library using go_download_sdk (and go_sdk.download for Bzlmod).

Example:

    go_download_sdk(
        name = "go_sdk",
        sdks = {
            "linux_amd64": (
                "go{}.linux-amd64.mirror6598503.tar.gz".format(go_version),
                "3f5c50e592d8845d30eebd08ddb9c670fd2d909e032b6c2b83ecf97afb34660c",
            ),
            "darwin_arm64": (
                "go{}.darwin-arm64.mirror6598503.tar.gz".format(go_version),
                "fbe78beee7861da09de9319498a1521bc41a8b79d3ead2218ce307b9fa5503e5",
            ),
        },
        patches = [
            "//patches:golang_osx_dns_workaround.patch",
        ],
        urls = ["https://dl.google.com/go/{}"],
        version = go_version,
    )

Other changes included:

Full Changelog: v0.41.0...v0.42.0

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.21.1")

v0.41.0

10 Jul 21:54
58534a2
Compare
Choose a tag to compare

What's Changed

Starting this release, rules_go no longer ship with @go_googleapis repo. Together with Gazelle v0.32.0, it means that all Go code importing generated code from Google APIs will depend on @org_golang_google_genproto, which is resolved by Go modules. For proto files importing Google APIs proto and generating Go code, users need to:

  1. Add an http_archive rule to download Google APIs, e.g.,
http_archive(
    name = "googleapis",
    sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
    strip_prefix = "googleapis-64926d52febbf298cb82a8f472ade4a3969ba922",
    urls = [
        "https://github.com/googleapis/googleapis/archive/64926d52febbf298cb82a8f472ade4a3969ba922.zip",
    ],
)

load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")

switched_rules_by_language(
    name = "com_google_googleapis_imports",
)

Note that the version of Google APIs archive needs to be compatible with the pre-generated code in @org_golang_google_genproto.

  1. Resolve the proto manually. If Gazelle is being used, directives like the following need to be added to a parent directory of the proto files:
# gazelle:resolve proto proto google/rpc/status.proto @googleapis//google/rpc:status_proto
# gazelle:resolve proto go google/rpc/status.proto  @org_golang_google_genproto//googleapis/rpc/status
# gazelle:resolve proto google/longrunning/operations.proto @googleapis//google/longrunning:operations_proto
# gazelle:resolve proto go google/longrunning/operations.proto @org_golang_google_genproto//googleapis/longrunning

Other changes included in this release

  • detect_sdk_version: Support 1.21's new VERSION file format by @evanj in #3600
  • stdlib: Do not pass -static to cgo by @zecke in #3593
  • Expand stdlib packages when queried by @JamyDev in #3606
  • Fix stdlib file outputs pointing to processwrapper by @JamyDev in #3608
  • Fix go_sdk extension failure for unnamed root module by @fmeum in #3612
  • Adding Uber's hermetic cc toolchain for tests by @linzhp in #3609
  • Implement functionality to skip tests via TESTBRIDGE_TEST_ONLY env by @yushan26 in #3618

Full Changelog: v0.40.1...v0.41.0

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.20.5")

v0.40.1

28 Jun 19:04
Compare
Choose a tag to compare

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.20.5")

Changes

This patch release cherry-picked two bug fixes related to Go package driver from master

v0.40.0

22 Jun 16:37
Compare
Choose a tag to compare

What's Changed

  • Revert "Add automatic platform detection from inbound crosstool_top a… by @fmeum in #3468
  • bzlmod: Add dedicated documentation by @fmeum in #3519
  • Create TEST_SHARD_STATUS_FILE when sharding tests by @fmeum in #3547
  • Move CI flags to .bazelrc and fix BwoB build by @fmeum in #3551
  • Re-enable go_path_test on RBE by @sluongng in #3539
  • nogo: provide usage doc by @sluongng in #3534
  • respect global strip config by @malt3 in #3527
  • stdliblist: return generated files by @grampelberg in #3552
  • Fix formatting in nogo usage doc by @sluongng in #3557
  • Fix goexperiment.* build tags by @lbcjbb in #3556
  • Remove tests for go_path's link mode by @fmeum in #3565
  • Fix tests with --incompatible_disable_starlark_host_transitions by @fmeum in #3560
  • Create empty .go file in a random location by @fmeum in #3566
  • gopackagesdriver: fix interface to work with golangci-lint (#3523) by @grampelberg in #3524
  • Fix typo in load statement for bzlmod docs by @Sovietaced in #3570
  • context: remove unused import by @sluongng in #3571
  • docs: Mention use_repo automation by @fmeum in #3573
  • Test basic-gazelle example with incompatible flags by @fmeum in #3575
  • go_sdk extension: create go_host_compatible_sdk repository by @ylecornec in #3543
  • docs: Mention that gazelle:prefix can be replaced by go.mod by @fmeum in #3577
  • go_download_sdk: apply extraction workaround to zips on non-windows OSs by @jayconrod in #3563
  • Fix go_download_sdk with Bazel dev versions by @fmeum in #3580
  • Implement //nolint parsing similar to golangci-lint by @patrickmscott in #3562

New Contributors

Full Changelog: v0.39.1...v0.40.0

WORKSPACE code

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

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

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.20.5")