Repository navigation
v0.25.0
Pre-release
Pre-release
Changes
go_download_sdkandgo_register_toolchainscan now download any version of Go fromgolang.org/dlwithout the need for hardcoded support in rules_go.- Consequently, the
versionparameter must be set to a string like"1.15.5"or to"host". This requires a change toWORKSPACEfor most users. Seego_register_toolchainsfor details. go_download_sdkquerieshttps://golang.org/dlin order to find SHA-256 of toolchains. Bazel won't cache downloaded files without these. If your build has limited network access, useversion = "host"or set thesdksandurlsattributes ingo_download_sdk.- As a result of this change, rules_go will no longer need patch releases for new Go versions. The v0.24 branch will still be patched as long as it's supported.
- Consequently, the
- Package conflicts are now errors rather than warnings. The linker already reports errors for most of these since Go 1.15.
- rules_go now uses Bazel's modern C/C++ Starlark linker API.
go_pathsupports theinclude_transitiveattribute, which controls whether transitively imported packages are included (thanks @steeve)go_testchanges to the test directory in aninitfunction run before other packageinits instead of inmain(thanks @dragonsinth)- Several deprecated features were removed. See Deprecation schedule for information on removals.
go_rulewrapper.go_archive_aspectandGoAspectProvider.- It is now an error when a
go_binaryorgo_testdepends on anothergo_binaryorgo_test. --featureflags are no longer used for configuration. Use flags like--@io_bazel_rules_go//go/config:pureinstead.
Compatibility
- Go 1.13 is no longer supported.
- Bazel 3.4.0 is now required.
- This release is expected to be compatible with Bazel 4.0.0. Earlier rules_go releases may not work due to incompatible changes in the C/C++ APIs.
Updated dependencies
As always you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.
platformsis updated to0.0.1.rules_ccis updated tomasteras of 2020-12-01.bazel_skylibis updated to1.0.3.org_golang_x_toolsis updated tomasteras of 2020-12-01.com_github_golang_protobufis updated tov1.4.3.org_golang_google_genprotois updated tomasteras of 2020-12-01.go_googleapisis updated tomasteras of 2020-12-01.
WORKSPACE code
NOTE: The code below has changed. In go_register_toolchains, version must be set to a string like "1.15.5" or to "host" unless a Go toolchain is declared earlier.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "6f111c57fd50baf5b8ee9d63024874dd2a014b069426156c55adbf6d3d22cb7b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.15.5")