Repository navigation
0.19.0
Pre-release
Pre-release
Compatibility
The minimum supported version of Bazel is now 0.23.0.
Ubuntu 14.04 is no longer supported.
Changes
- When cross-compiling, a C/C++ toolchain is no longer required. Previously, a toolchain was required but usually not used. To cross-compile with cgo, add a
_cgosuffix to the target platform. For example,--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64_cgo. - When stamping
go_binaryandgo_testswith thex_defsattribute, the--stampcommand-line flag must be used. Without this flag, link stamping is not done. This improves caching of link actions and is consistent with whatcc_binaryand other native Bazel rules do. - A repository named
go_sdkis no longer required.go_register_toolchainswill automatically detect any declared SDK workspaces. This simplifies workspaces that use both local and remote execution. linkmode = "pie"is now supported ingo_binaryandgo_test.go_librarynow supports animportpath_aliasesattribute that accepts a list of alternative strings that may be used to import the package. This is needed for minimal module compatibility.- Go packages are now built with a single
GoCompilePkgaction. We no longer use separate actions for compilation, coverage, assembly, packing, etc. cgo code is no longer built withcc_libraryand custom rules. This should reduce overhead in remote execution configurations.
Deprecations
- The
objc = Truefeature is now deprecated.go_libraryand other rules can now compile .m and .mm files directly whencgo = Trueis set. - Go 1.10 support is now deprecated.
See Deprecation schedule for more information.
Updated dependencies
bazel_skylibhas been updated to 0.8.0.org_golang_x_toolshas been updated tomasteras of 2019-07-08.com_github_golang_protobufhas been updated to v1.3.1.com_github_mwitkow_go_proto_validatorshas been updated tomasteras of 2019-07-08.go_googleapishas been updated tomasteras of 2019-07-09.
Several workspaces are no longer declared in go_rules_dependencies.
com_google_protobufis no longer declared. Users ofproto_libraryandgo_proto_librarymust declared it separately in WORKSPACE. Its dependencies must also be declared using its dependency macro,protobuf_deps, declared in@com_google_protobuf//:protobuf_deps.bzl. See Proto dependencies for more information.org_golang_google_grpcis no longer declared. Recent versions have a large number of dependencies, and we can't realistically manage all of them. It's better to import them asgo_repositoryrules usinggazelle update-repos. See gRPC dependencies for more information.org_golang_x_net,org_golang_x_text, andorg_golang_x_sysare no longer declared. They were provided as dependencies of gRPC.com_github_golang_glogis no longer declared. It was only used in a legacy example.com_github_kevinburke_go_bindatais now declared in thego_embed_data_dependenciesmacro in@io_bazel_rules_go//extras:embed_data_deps.bzl. It has been updated to v3.13.0, the latest version as of 2019-07-08.
WORKSPACE code
To use this release, add the code below to your WORKSPACE file.
REMINDER: com_google_protobuf and some other proto repositories are no longer declared in go_rules_dependencies. See Proto dependencies and gRPC dependencies for details.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
],
sha256 = "9fb16af4d4836c8222142e54c9efa0bb5fc562ffc893ce2abeac3e25daead144",
)
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()