github bazel-contrib/rules_go v0.23.0

latest releases: v0.50.1, v0.50.0, v0.49.0...
pre-release4 years ago

Changes

  • rules_go now supports the new API for protocol buffers.
    • To summarize the announcement, there's a new protobuf module, google.golang.org/protobuf (APIv2). The old module, github.com/golang/protobuf (APIv1) has been re-implemented in terms of the new module. Using either API is fine.
    • rules_go will continue to use protoc-gen-go from APIv1 for now, since the APIv2 does not support gRPC, and there is no gRPC generator yet. See the note on gRPC support in the v1.20.0 release notes.
    • Code generated with either module should work with both APIs. However, code generated with older versions of APIv1 will not not work with the latest version of either module.
  • rules_go has migrated to Starlark build settings and configuration transitions.
    • Instead of using feature flags like --features=race, you can now use flags like --@io_bazel_rules_go//go/config:race.
    • go_binary and go_test mode attributes such as race, pure, goos, and goarch have been reimplemented using transitions. Conditional dependencies chosen with select should now work correctly.
    • go_binary and go_test now support a gotags attribute, which lets a binary and its dependencies be built with a list of build constraints. This can also be set on the command line with --@io_bazel_rules_go//go/config:tags.
    • Output file paths no longer include extra configuration data. For example, //tests/core/go_binary:hello creates the file bazel-bin/tests/core/go_binary/hello_/hello. Note that output file paths are still not stable and should not be depended on unless the "out" attribute is set explicitly (for rules that support it).

Compatibility

  • The minimum supported version of Bazel is now 2.2.0. This version bump was needed to take advantage of support for build settings and configuration transitions.
  • Go versions older than 1.13 are no longer supported.
  • The deprecated searchpaths and searchpath fields have been removed from GoArchive and GoArchiveData.

Updated dependencies

  • platforms is updated to master as of 2020-05-12.
  • rules_cc is updated to master as of 2020-05-12.
  • org_golang_x_tools is updated to master as of 2020-05-12.
  • org_golang_x_xerrors (golang.org/x/xerrors) is added at master as of 2020-05-12. It's needed by org_golang_x_tools.
  • org_golang_google_protobuf (google.golang.org/protobuf) is added at v1.22.0, latest as of 2020-05-12.
  • com_github_golang_protobuf is updated to v1.4.1, latest as of 2020-05-12.
  • org_golang_google_genproto is updated to master as of 2020-05-12.
  • go_googleapis is updated to master as of 2020-05-12.

WORKSPACE code

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

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "6a68e269802911fa419abb940c850734086869d7fe9bc8e12aaf60a09641c818",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.0/rules_go-v0.23.0.tar.gz",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.23.0/rules_go-v0.23.0.tar.gz",
    ],
)

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

go_rules_dependencies()

go_register_toolchains()

Don't miss a new rules_go release

NewReleases is sending notifications on new releases.