New features
- Go 1.10.2 and 1.9.6 are now supported.
- Preliminary support for Objective C code in cgo
srcs
andcdeps
.
objc = True
must be set ingo_library
to use this. It will only
work on macOS, since it requires an Apple toolchain. go_binary
andgo_test
once again supportimportpath
attributes. These
targets are not importable, butgo_path
and other rules can use these to
place source files in appropriate directories.- Build ids are no longer written into compiled standard library packages. This
improve reproducibility.
Notes
- Some important bug fixes have landed in Gazelle around proto dependency
resolution. rules_go declares a@bazel_gazelle
repository with these fixes,
but this will be removed in the future. You should declare@bazel_gazelle
explicitly in your WORKSPACE (see
Running Gazelle with Bazel
for setup instructions). - Several deprecated features are removed in this release.
- The
library
attribute is removed in favor ofembed
. - The
linkstamp
attribute is removed in favor ofx_defs
. - The
go_sdk
andgo_repositories
rules are removed in favor of
go_rules_dependencies
,go_register_toolchains
and related functions. cgo_library
andcgo_genrule
are removed in favor ofgo_library
.- The legacy proto rules in
proto/go_proto_library.bzl
are removed in favor
of the new proto rules inproto/def.bzl
.
- The
- Several more features are deprecated and scheduled for removal in the next
release. See Deprecation schedule for more information.- Go 1.8 will no longer be supported.
go_prefix
will be removed in favor ofimportpath
attributes.- The legacy
go_repository
andnew_go_repository
will be removed in favor
of the
equivalent rule
in the Gazelle repository.
Updated dependencies
The following repositories declared in go_rules_dependencies()
were updated to
new versions.
bazel_gazelle
to master as of 2018-05-08.com_github_golang_protobuf
to v1.1.0.com_github_mwitkow_go_proto_validators
to master as of 2018-05-07.org_golang_x_net
to master as of 2018-05-07.org_golang_google_grpc
to v1.10.3.org_golang_google_genproto
to master as of 2018-05-07.
WORKSPACE code
To use this release, add this code to your WORKSPACE file:
http_archive(
name = "io_bazel_rules_go",
url = "https://github.com/bazelbuild/rules_go/releases/download/0.12.0/rules_go-0.12.0.tar.gz",
sha256 = "c1f52b8789218bb1542ed362c4f7de7052abcf254d865d96fb7ba6d44bc15ee3",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()