Releases: bazel-contrib/rules_go
v0.29.0
Changes
-
nogo analyzers may now depend on
go_library
rules (#2922).This is a major upgrade to nogo usability that enables the use of
the popular staticcheck tool, via
https://github.com/sluongng/staticcheck-codegen.This requires an update to Gazelle v0.24
Many thanks to @thomas-wk
-
Editor / IDE integration (gopackagesdriver) now supports automatic target detection (#2932).
No user input is required after the
GOPACKAGESDRIVER
setup.
This effectively deprecates the following environment variables:GOPACKAGESDRIVER_BAZEL_TARGETS
GOPACKAGESDRIVER_BAZEL_QUERY
GOPACKAGESDRIVER_BAZEL_TAG_FILTERS
Many thanks to @steeve for his ongoing development of gopackagesdriver
-
The rules_cc dependency has been removed (#2950).
-
rules_go tool builds are now reproducible (#2952).
Thanks to all of the contributors.
Compatibility
- Bazel 4.2.0 or higher is now required. The previous minimum version
was 4.0.0.
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.
bazel_skylib
updated tov1.1.1
org_golang_x_tools
updated tov0.1.7
org_golang_x_sys
updated tomaster
as of 2021-10-06.org_golang_google_genproto
updated tomaster
as of 2021-10-06.go_googleapis
updated tomaster
as of 2021-10-06.
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.17.1")
http_archive(
name = "bazel_gazelle",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
v0.28.0
Changes
- Experimental editor / IDE integration added in the form of a
gopackagesdriver tool that reports information about the Bazel workspace
to gopls (or any other tool based ongolang.org/x/tools/go/packages
).
See the Editor setup
on the wiki for information and setup instructions. Huge thanks to @steeve
for shipping this. - Target platform may be automatically inferred from
--crosstool_top
and
--cpu
for iOS and Android platforms that still require these flags.
Again, thanks to @steeve. go_proto_library
no longer implicitly depends on APIv1 Well Known Type
packages. Since protoc 3.14, the Well Known Types declare APIv2 package paths,
which means generated code that imports them will import APIv2 packages,
so the APIv1 dependencies are unnecessary.
Compatibility
- Bazel 4.0.0 (LTS) or higher is now required. The previous minimum version
was 3.5.0.
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.
org_golang_x_tools
updated tov0.1.4
org_golang_x_sys
updated tomaster
as of 2021-06-30.rules_cc
updated tomain
as of 2021-06-30.org_golang_google_protobuf
updated tov1.27.1
.org_github_golang_protobuf
updated tov1.5.2
.org_golang_google_genproto
updated tomaster
as of 2021-06-30.go_googleapis
updated tomaster
as of 2021-06-30.
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.16.5")
v0.27.0
Updated dependencies
This release updates golang.org/x/tools
, which was mistakenly not updated in v0.26.0. Additionally, the latest version of golang.org/x/tools
requires golang.org/x/sys/execabs
, so that module is added as a new dependency.
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.
org_golang_x_tools
is updated tov0.1.0
.org_golang_x_sys
is added atmaster
as of 2021-03-17.
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.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.16.2")
v0.24.14
New Go versions
Go 1.16.2, 1.16.1, 1.15.10, and 1.15.9 are now supported.
WORKSPACE code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "e0015762cdeb5a2a9c48f96fb079c6a98e001d44ec23ad4fa2ca27208c5be4fb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.14/rules_go-v0.24.14.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.14/rules_go-v0.24.14.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
v0.26.0
Changes
//go:embed
directives are supported in Go 1.16. Patterns are matched against both static and generated files, including directory artifacts. Embeddable files must be listed in the newembedsrcs
attribute. Gazelle v0.23.0 will generate these attributes automatically.go_binary
now providesCcInfo
in thec-archive
andc-shared
link modes. This should letcc_library
and other rules reference these targets throughdeps
directly. Thanks @steeve.TEST_TMPDIR
is no longer set toTMPDIR
in tests. Thanks @mikedanese.- Several small improvements in error and diagnostic output.
Compatibility
- Bazel 3.5.0 is now required. The previous minimum version was 3.4.0.
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.
platforms
is updated to0.0.4
.rules_cc
is updated tomaster
as of 2021-03-05.org_golang_x_tools
is updated tomaster
as of 2021-03-05.org_golang_google_genproto
is updated tomaster
as of 2021-03-05.go_googleapis
is updated tomaster
as of 2021-03-05.
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "7c10271940c6bce577d51a075ae77728964db285dac0a46614a7934dc34303e6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.26.0/rules_go-v0.26.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.26.0/rules_go-v0.26.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.16")
v0.24.13
New Go versions
Go 1.16 is now supported.
WORKSPACE code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "52d0a57ea12139d727883c2fef03597970b89f2cc2a05722c42d1d7d41ec065b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
v0.24.12
New Go versions
Go 1.15.8 and 1.14.15 are now supported.
WORKSPACE code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "4d838e2d70b955ef9dd0d0648f673141df1bc1d7ecf5c2d621dcc163f47dd38a",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.12/rules_go-v0.24.12.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.12/rules_go-v0.24.12.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
v0.24.11
New Go versions
Go 1.15.7 and 1.14.14 are now supported.
WORKSPACE code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "dbf5a9ef855684f84cac2e7ae7886c5a001d4f66ae23f6904da0faaaef0d61fc",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.11/rules_go-v0.24.11.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.11/rules_go-v0.24.11.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()
v0.25.1
Bug fixes
- Fixed an issue in
go_test
with capturing XML output when changing directories. - Paths in error messages are now relativized. This should reduce noise from Bazel sandbox directories. (thanks @robfig)
go_local_sdk
provides better error messages when Go is built for multiple platforms. (thanks @prattmic)- Multiple compatibility fixes for Go 1.16beta1.
WORKSPACE code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "7904dbecbaffd068651916dce77ff3437679f9d20e1a7956bff43826e7645fcc",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.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.6")
v0.24.10
Bug fixes
- Paths in error messages are now relativized. This should reduce noise from Bazel sandbox directories. (thanks @robfig)
go_local_sdk
provides better error messages when Go is built for multiple platforms. (thanks @prattmic)- Multiple compatibility fixes for Go 1.16beta1.
WORKSPACE code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "8e9434015ff8f3d6962cb8f016230ea7acc1ac402b760a8d66ff54dc11673ca6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.10/rules_go-v0.24.10.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.10/rules_go-v0.24.10.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains()