Releases: bazel-contrib/rules_go
v0.55.1
This includes:
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.24.4")
v0.55.0
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "c6cf9da6668ac84c470c43cbfccb8fdc844ead2b5a8b918e2816d44f2986f644",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.0/rules_go-v0.55.0.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.55.0/rules_go-v0.55.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.24.3")
What's Changed
- Checking test suite duration by @linzhp in #4323
- Revert "Fail when expected files are not produced by protoc (#4287)" by @linzhp in #4324
- Add imacros to absolutized cgo env list by @LaurenceTews in #4325
- go_cross: allow transition on compilation_mode by @sluongng in #4320
- Pass config to subanalyzers by @grzegorzsn in #4330
- Update BCR presumit matrix by @linzhp in #4331
- Work around incompatibility between zlib and clang 17 by @fmeum in #4332
- Export new location of support files needed for using Go's WASM output. by @malt3 in #4322
- Fix incompatibility with
--incompatible_auto_exec_groups
by @fmeum in #4141 - Re-spawned test binary should not break PWD by @abhinav in #4336
- Only emit patch file if nogo has fixes by @fmeum in #4269
- Rename
out
toout_diagnostics
by @fmeum in #4341 - Remove rules_proto by @comius in #4339
- Remove shadow analyzer from TOOLS_NOGO by @gpanders in #4344
- Disable
pkgfact
analyzer by @fmeum in #4349 - Discourage references to the default SDK by @fmeum in #4351
- go/tools/gopackagesdriver: Adding Cgo support by @r-hang in #4338
- Pass headers along as transitive dependencies by @patrickmscott in #4298
- Allowing a go_proto_compiler to indicate whether it always generate files by @linzhp in #4364
- fix: merge '-Wl,' with next value so extldflags can accept flags like " -Wl,xxxx" by @luzhanning in #4367
New Contributors
- @LaurenceTews made their first contribution in #4325
- @grzegorzsn made their first contribution in #4330
- @comius made their first contribution in #4339
- @gpanders made their first contribution in #4344
- @r-hang made their first contribution in #4338
- @luzhanning made their first contribution in #4367
Full Changelog: v0.54.1...v0.55.0
v0.54.1
This release include two bug fixes:
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "130739704540caa14e77c54810b9f01d6d9ae897d53eedceb40fd6b75efc3c23",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.54.1/rules_go-v0.54.1.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.54.1/rules_go-v0.54.1.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.24.3")
Full Changelog: v0.54.0...v0.54.1
v0.54.0
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "f2d15bea3e241aa0e3a90fb17a82e6a8ab12214789f6aeddd53b8d04316d2b7c",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.54.0/rules_go-v0.54.0.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.54.0/rules_go-v0.54.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.24.2")
What's Changed
- Mark gomock() hidden targets manual by @EdSchouten in #4265
- Bump golang.org/x/tools to a version that supports Go 1.24.0. by @benjaminp in #4266
- Avoid Gazelle recognizing an internal repo as a Go SDK repo by @fmeum in #4264
- Generate exports for stdlib by @jgautier-dd in #4244
- Don't swallow errors when running nogo by @fmeum in #4271
- gopackagesdriver: skip root packages that can't be built by @jayconrod in #3806
- Grouping subtests using test suites in test.xml by @linzhp in #4275
- Update Go SDKs by @fmeum in #4272
- Preserve
nogo
runfiles by @fmeum in #4270 - Generate facts for targets not in nogo scope by @fmeum in #4268
- Use upstream definitions, fix gopackagesdriver by @rv32ima in #4185
- Bug fix: proto: add gofeaturespb as well-known type; Go Protobuf ships it by @stapelberg in #4279
- Calculating the test suite duraion from timestamps by @linzhp in #4281
- Stop using Label.workspace_name by @EdSchouten in #4282
- Fail when expected files are not produced by protoc by @linzhp in #4287
- add workspaceFiles to vim configuration documentation by @rv32ima in #4290
- Fix goos and goarch options in go_wrap_sdk by @patrickmscott in #4295
- Escape backslashes and newlines in response files by @alopezz in #4297
- Add wrap extension tag to implement go_wrap_sdk by @patrickmscott in #4301
- fix the reporting message for getFixes by @peng3141 in #4299
- Producing "fail" event when a test case panics by @linzhp in #4306
- fix(cgo): exclude crypto/internal/sysrand/internal/seccomp from SDK srcs by @adam-azarchs in #4311
- fix(gomock): add missing mnemonic to gomock action by @tyler-french in #4313
- go_sdk: Pick a consistent repo name to improve cachability by @zecke in #4314
- Add
go_sdk.from_file
to read the SDK version fromgo.mod
. by @jaqx0r in #4305 - deps: Get repositories.bzl in sync with go.mod by @adam-azarchs in #4316
New Contributors
- @jgautier-dd made their first contribution in #4244
- @rv32ima made their first contribution in #4185
- @stapelberg made their first contribution in #4279
- @alopezz made their first contribution in #4297
- @jaqx0r made their first contribution in #4305
Full Changelog: v0.53.0...v0.54.0
v0.53.0
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "b78f77458e77162f45b4564d6b20b6f92f56431ed59eaaab09e7819d1d850313",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.53.0/rules_go-v0.53.0.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.53.0/rules_go-v0.53.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.24.0")
What's Changed
- Improve the comment for
go_sdk.host()
in the installation docs by @stefanobaghino in #4230 - Use same Go SDK as Gazelle for
go_bazel_test
by @fmeum in #4231 - Allow .so files to have more extensions by @matshch in #4232
- Update documentation reference by @phst in #4237
- Update protoc plugins to support Protobuf Editions by @mering in #4236
- Fix bullet point format in readme by @bluec0re in #4239
- sdk: remove logic for Bazel versions below 6.4.0 by @sluongng in #4238
- Add new setting //go/toolchain:sdk_name to allow the selection of a specific Go toolchain by @bluec0re in #4242
- Mention
dev_dependency
ingo_sdk.host
error by @fmeum in #4246 - Keep order for PATH components by @lukasoyen in #4252
- Reporting subtests as they finish by @linzhp in #4250
- Capturing elapsed time of interrupted test cases due to timeout by @linzhp in #4253
- Fix upgrade-dep patching system by @stevebarrau in #4254
- Rewrite examples and new user documentation by @jayconrod in #4251
- Fixing a flaky test by @linzhp in #4257
- Sync test2json from upstream Go by @linzhp in #4261
- Populate timestamp in test.xml by @linzhp in #4259
New Contributors
- @stefanobaghino made their first contribution in #4230
- @matshch made their first contribution in #4232
- @bluec0re made their first contribution in #4239
- @lukasoyen made their first contribution in #4252
- @stevebarrau made their first contribution in #4254
Full Changelog: v0.52.0...v0.53.0
v0.52.0
MODULE.bazel
code
bazel_dep(name = "rules_go", version = "0.52.0")
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "90fe8fb402dee957a375f3eb8511455bd738c7ed562695f4dd117ac7d2d833b1",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.52.0/rules_go-v0.52.0.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.52.0/rules_go-v0.52.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.23.4")
What's Changed
- Update embedding.md to correct typo by @mju in #4188
- Support Go 1.24's wasip1 reactors by @leonm1 in #4201
- fix: Make context.mode always be GoConfigInfo by @dzbarsky in #4203
- chore: remove Travis-specific install docs by @alexeagle in #4208
- Undo API-breaking change to go_sdk experiments attribute by @dzbarsky in #4210
- docs: update core link reference from .bzl to .rst by @athongsavath in #4214
- chore(docs): move WORKSPACE docs out of primary README by @alexeagle in #4209
- Disable mac CI, update Linux by @linzhp in #4220
- feat: Saving the nogo fixes by @peng3141 in #4102
- Build stdlib with msan support by @smertnik3sh in #4218
- Get
go_bazel_test
s to pass with Bzlmod by @fmeum in #4223
New Contributors
- @mju made their first contribution in #4188
- @leonm1 made their first contribution in #4201
- @athongsavath made their first contribution in #4214
- @peng3141 made their first contribution in #4102
- @smertnik3sh made their first contribution in #4218
Full Changelog: v0.51.0...v0.52.0
v0.51.0
Breaking changes
In order to reduce CPU and memory usage in the analysis phase and to improve the maintainability of the codebase, this release contains a number of breaking changes.
As the bulk of these changes are to the Go context API, users of the go_*
rules should not be affected (with a very minor exception below).
The maintainers would like to give a special thanks to @dzbarsky for numerous contributions to this release!
Changes to rules
- Support for inferring an importpath for libraries named
go_default_library
has been removed. Modern versions of Gazelle do not generate this target name, please ensure you are up to date. (c8a7ebca3)
Changes to the Go context API and behavior
-
Converted SDK files to depsets (
go.sdk.tools
,go.sdk.headers
,go.sdk.libs
,go.sdk.srcs
). To migrate, either callto_list()
on those properties or, preferably, use them asdepset
s in your downstream actions. To remain compatible with older versions, consider a conditional conversion such asdepset_or_list if type(depset_or_list) == type([]) else depset_or_list.to_list()
(3994841a) -
go.sdk_files
has been removed and can be replaced withdepset(direct = [go.sdk.go], transitive = [go.sdk.srcs, go.sdk.headers, go.sdk.libs, go.sdk.tools])
(which is adepset
). Wherever possible, try to use only the subset of those files that's actually needed. -
GoSource
andGoLibrary
providers have been merged and renamed toGoInfo
. The previous names are now aliases, but can result in errors about duplicate providers when both are returned from the same rule.go.new_library
andgo.library_to_source
are now deprecated. To migrate, usego.new_go_info
. To remain compatible with older versions that require both providers, consider checking whetherGoSource != GoLibrary
. (564f8204) -
Some fields on the Go context object are marked deprecated.
go_context
will still add them to the context object, unless it is invoked withinclude_deprecated_properties = False
. This default will be flipped in the future and eventually this codepath will be removed. (aa96a1174) You can migrate as follows:go.root
->go.env["GOROOT"]
go.go
->go.sdk.go
go.sdk_root
->go.sdk.root_file
go.sdk_tools
->go.sdk.tools
go.package_list
->go.sdk.package_list
go.tags
->go.mode.tags
go.stamp
->go.mode.stamp
go.cover_format
->go.mode.cover_format
go.pgoprofile
->go.mode.pgoprofile
-
Removed
get_nogo
from the Go context object (0f88f8c8) -
Removed
exe_extension
andshared_extension
from the Go context object. (c419453a) -
Removed
GoSource.cc_info
. If you need to access theCcInfo
from a Go target, you will need to apply the_go_cc_aspect
fromgo/private/rules/binary.bzl
. Please let us know if it's needed and we can move it to public API. (a01ba7c72) -
go_binary
andgo_test
targets no longer exposeGoInfo
,GoSource
orGoLibrary
providers. If you need a dedicated provider to attach an aspect to, please let us know. (2d2266) -
The Go context's
mode
property is now aGoConfigInfo
provider instead of a bare struct.go.mode.link
has been renamed togo.mode.linkmode
(5933f872) -
If you are relying on
go_context
to read an_stdlib
attribute from yourattr
s, please ensure the attribute is not transitioned, as it will no longer handle a list value. (9214edcd126) -
go_context
now accepts keyword arguments for the following fields:go_context_data
,importpath
,importmap
,embed
,importpath_aliases
. If these properties are omitted, the function will continue to fall back to reading them fromattr
. Consider passing these explicitly to improve code clarity and analysis phase performance. (6749a3819, f3029e2a8)
Changes to providers
GoSource
-
Removed
cgo_deps
, usecdeps
instead (56d415d) -
Removed
orig_srcs
(520bee50) -
Removed
cgo_exports
(86c3f3ae97) -
Converted
cover
to adepset
(692d008c96) -
deps
is now a list ofGoArchive
s instead ofTarget
s (a32f3e1)
GoArchive
- Removed
mode
, usesource.mode
instead (bfd99a663)
GoArchiveData
- Removed
data_files
, use withrunfiles
instead, which is arunfiles
object (60f55c91ce)
CgoContextInfo
- Converted
cc_toolchain_files
to adepset
(3994841)
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "0936c9bc3c4321ee372cb8f66dd972d368cb940ed01a9ba9fd7debcf0093f09b",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.51.0/rules_go-v0.51.0.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.23.4")
What's Changed
- Lazy expand absolute path to avoid including them in the output by @AlessandroPatti in #4009
- Stop splitting sources in emit_archive by @dzbarsky in #4015
- Remove split_srcs by @dzbarsky in #4019
- Remove orig_src_map by @dzbarsky in #4025
- Simplify how we emit GoStdLib by @dzbarsky in #4026
- Cleanup GoArchiveData runfiles handling by @dzbarsky in #4024
- Use depset for SDK files by @dzbarsky in #4014
- Tweak how we pass GOEXPERIMENT to actions by @dzbarsky in #4022
- Remove get_nogo from context by @dzbarsky in #4029
- Remove mode from GoArchive by @dzbarsky in #4028
- Remove cgo_deps from GoSource provider by @dzbarsky in #4031
- Cleanup binary extension computation by @dzbarsky in #4033
- add docs for
go_deps.gazelle_default_attributes
by @tyler-french in #4021 - Tweak nogo archive handling by @dzbarsky in #4023
- Prefer rfind to rpartition in go_context by @dzbarsky in #4035
- Add qnx and osx platforms by @hofbi in #4036
- Move PATH env-var computation to GoContextInfo by @dzbarsky in #4037
- Turn source.cover into a depset by @dzbarsky in #4039
- Create shallower runfiles by @dzbarsky in #4040
- docs: add missing anchor to Bazel toolchains definition by @albertocavalcante in #4042
- Cleanup compilepkg flags handling by @dzbarsky in #4043
- GoSource can store dependent archives instead of full deps by @dzbarsky in #4041
- Remove some fields from Go context by @dzbarsky in #4034
- Optimize CcInfo computation by @dzbarsky in #4020
- Remove GoSource/GoLibrary from test/binary rules by @dzbarsky in #4044
- Remove orig_srcs by @dzbarsky in #4038
- Cleanup infer_importpath by @dzbarsky in #4047
- Cleanup importpath/importmap handling in go_context by @dzbarsky in #4052
- Remove cgo_exports from GoSource by @d...
v0.51.0-rc2
Breaking changes
In order to reduce CPU and memory usage in the analysis phase and to improve the maintainability of the codebase, this release contains a number of breaking changes.
As the bulk of these changes are to the Go context API, users of the go_*
rules should not be affected (with a very minor exception below).
The maintainers would like to give a special thanks to @dzbarsky for numerous contributions to this release!
Changes to rules
- Support for inferring an importpath for libraries named
go_default_library
has been removed. Modern versions of Gazelle do not generate this target name, please ensure you are up to date. (c8a7ebca3)
Changes to the Go context API and behavior
-
Converted SDK files to depsets (
go.sdk.tools
,go.sdk.headers
,go.sdk.libs
,go.sdk.srcs
). To migrate, either callto_list()
on those properties or, preferably, use them asdepset
s in your downstream actions. To remain compatible with older versions, consider a conditional conversion such asdepset_or_list if type(depset_or_list) == type([]) else depset_or_list.to_list()
(3994841a) -
go.sdk_files
has been removed and can be replaced withdepset(direct = [go.sdk.go], transitive = [go.sdk.srcs, go.sdk.headers, go.sdk.libs, go.sdk.tools])
(which is adepset
). Wherever possible, try to use only the subset of those files that's actually needed. -
GoSource
andGoLibrary
providers have been merged and renamed toGoInfo
. The previous names are now aliases, but can result in errors about duplicate providers when both are returned from the same rule.go.new_library
andgo.library_to_source
are now deprecated. To migrate, usego.new_go_info
. To remain compatible with older versions that require both providers, consider checking whetherGoSource != GoLibrary
. (564f8204) -
Some fields on the Go context object are marked deprecated.
go_context
will still add them to the context object, unless it is invoked withinclude_deprecated_properties = False
. This default will be flipped in the future and eventually this codepath will be removed. (aa96a1174) You can migrate as follows:go.root
->go.env["GOROOT"]
go.go
->go.sdk.go
go.sdk_root
->go.sdk.root_file
go.sdk_tools
->go.sdk.tools
go.package_list
->go.sdk.package_list
go.tags
->go.mode.tags
go.stamp
->go.mode.stamp
go.cover_format
->go.mode.cover_format
go.pgoprofile
->go.mode.pgoprofile
-
Removed
get_nogo
from the Go context object (0f88f8c8) -
Removed
exe_extension
andshared_extension
from the Go context object. (c419453a) -
Removed
GoSource.cc_info
. If you need to access theCcInfo
from a Go target, you will need to apply the_go_cc_aspect
fromgo/private/rules/binary.bzl
. Please let us know if it's needed and we can move it to public API. (a01ba7c72) -
go_binary
andgo_test
targets no longer exposeGoInfo
,GoSource
orGoLibrary
providers. If you need a dedicated provider to attach an aspect to, please let us know. (2d2266) -
The Go context's
mode
property is now aGoConfigInfo
provider instead of a bare struct.go.mode.link
has been renamed togo.mode.linkmode
(5933f872) -
If you are relying on
go_context
to read an_stdlib
attribute from yourattr
s, please ensure the attribute is not transitioned, as it will no longer handle a list value. (9214edcd126) -
go_context
now accepts keyword arguments for the following fields:go_context_data
,importpath
,importmap
,embed
,importpath_aliases
. If these properties are omitted, the function will continue to fall back to reading them fromattr
. Consider passing these explicitly to improve code clarity and analysis phase performance. (6749a3819, f3029e2a8)
Changes to providers
GoSource
-
Removed
cgo_deps
, usecdeps
instead (56d415d) -
Removed
orig_srcs
(520bee50) -
Removed
cgo_exports
(86c3f3ae97) -
Converted
cover
to adepset
(692d008c96) -
deps
is now a list ofGoArchive
s instead ofTarget
s (a32f3e1)
GoArchive
- Removed
mode
, usesource.mode
instead (bfd99a663)
GoArchiveData
- Removed
data_files
, use withrunfiles
instead, which is arunfiles
object (60f55c91ce)
CgoContextInfo
- Converted
cc_toolchain_files
to adepset
(3994841)
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "1101d7e81a6e7f9cee94dd947bed705144bf339257fbec1d73d620df87e58885",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.51.0-rc2/rules_go-v0.51.0-rc2.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.51.0-rc2/rules_go-v0.51.0-rc2.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.23.3")
What's Changed
- Use rules_shell's sh_binary and sh_test by @ted-xie in #4182
- prepare rules_go release 0.51.0-rc2 by @fmeum in #4183
New Contributors
Full Changelog: v0.51.0-rc1...v0.51.0-rc2
v0.51.0-rc1
Breaking changes
In order to reduce CPU and memory usage in the analysis phase and to improve the maintainability of the codebase, this release contains a number of breaking changes.
As the bulk of these changes are to the Go context API, users of the go_*
rules should not be affected (with a very minor exception below).
The maintainers would like to give a special thanks to @dzbarsky for numerous contributions to this release!
Changes to rules
- Support for inferring an importpath for libraries named
go_default_library
has been removed. Modern versions of Gazelle do not generate this target name, please ensure you are up to date. (c8a7ebca3)
Changes to the Go context API and behavior
-
Converted SDK files to depsets (
go.sdk.tools
,go.sdk.headers
,go.sdk.libs
,go.sdk.srcs
). To migrate, either callto_list()
on those properties or, preferably, use them asdepset
s in your downstream actions. To remain compatible with older versions, consider a conditional conversion such asdepset_or_list if type(depset_or_list) == type([]) else depset_or_list.to_list()
(3994841a) -
go.sdk_files
has been removed and can be replaced withdepset(direct = [go.sdk.go], transitive = [go.sdk.srcs, go.sdk.headers, go.sdk.libs, go.sdk.tools])
(which is adepset
). Wherever possible, try to use only the subset of those files that's actually needed. -
GoSource
andGoLibrary
providers have been merged and renamed toGoInfo
. The previous names are now aliases, but can result in errors about duplicate providers when both are returned from the same rule.go.new_library
andgo.library_to_source
are now deprecated. To migrate, usego.new_go_info
. To remain compatible with older versions that require both providers, consider checking whetherGoSource != GoLibrary
. (564f8204) -
Some fields on the Go context object are marked deprecated.
go_context
will still add them to the context object, unless it is invoked withinclude_deprecated_properties = False
. This default will be flipped in the future and eventually this codepath will be removed. (aa96a1174) You can migrate as follows:go.root
->go.env["GOROOT"]
go.go
->go.sdk.go
go.sdk_root
->go.sdk.root_file
go.sdk_tools
->go.sdk.tools
go.package_list
->go.sdk.package_list
go.tags
->go.mode.tags
go.stamp
->go.mode.stamp
go.cover_format
->go.mode.cover_format
go.pgoprofile
->go.mode.pgoprofile
-
Removed
get_nogo
from the Go context object (0f88f8c8) -
Removed
exe_extension
andshared_extension
from the Go context object. (c419453a) -
Removed
GoSource.cc_info
. If you need to access theCcInfo
from a Go target, you will need to apply the_go_cc_aspect
fromgo/private/rules/binary.bzl
. Please let us know if it's needed and we can move it to public API. (a01ba7c72) -
go_binary
andgo_test
targets no longer exposeGoInfo
,GoSource
orGoLibrary
providers. If you need a dedicated provider to attach an aspect to, please let us know. (2d2266) -
The Go context's
mode
property is now aGoConfigInfo
provider instead of a bare struct.go.mode.link
has been renamed togo.mode.linkmode
(5933f872) -
If you are relying on
go_context
to read an_stdlib
attribute from yourattr
s, please ensure the attribute is not transitioned, as it will no longer handle a list value. (9214edcd126) -
go_context
now accepts keyword arguments for the following fields:go_context_data
,importpath
,importmap
,embed
,importpath_aliases
. If these properties are omitted, the function will continue to fall back to reading them fromattr
. Consider passing these explicitly to improve code clarity and analysis phase performance. (6749a3819, f3029e2a8)
Changes to providers
GoSource
-
Removed
cgo_deps
, usecdeps
instead (56d415d) -
Removed
orig_srcs
(520bee50) -
Removed
cgo_exports
(86c3f3ae97) -
Converted
cover
to adepset
(692d008c96) -
deps
is now a list ofGoArchive
s instead ofTarget
s (a32f3e1)
GoArchive
- Removed
mode
, usesource.mode
instead (bfd99a663)
GoArchiveData
- Removed
data_files
, use withrunfiles
instead, which is arunfiles
object (60f55c91ce)
CgoContextInfo
- Converted
cc_toolchain_files
to adepset
(3994841)
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "fcafde4bc064dc4e2b37b910e1aa61853a6e654e1927671eaca4853678f071d7",
urls = [
"https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.51.0-rc1/rules_go-v0.51.0-rc1.zip",
"https://github.com/bazel-contrib/rules_go/releases/download/v0.51.0-rc1/rules_go-v0.51.0-rc1.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.23.3")
What's Changed
- Lazy expand absolute path to avoid including them in the output by @AlessandroPatti in #4009
- Stop splitting sources in emit_archive by @dzbarsky in #4015
- Remove split_srcs by @dzbarsky in #4019
- Remove orig_src_map by @dzbarsky in #4025
- Simplify how we emit GoStdLib by @dzbarsky in #4026
- Cleanup GoArchiveData runfiles handling by @dzbarsky in #4024
- Use depset for SDK files by @dzbarsky in #4014
- Tweak how we pass GOEXPERIMENT to actions by @dzbarsky in #4022
- Remove get_nogo from context by @dzbarsky in #4029
- Remove mode from GoArchive by @dzbarsky in #4028
- Remove cgo_deps from GoSource provider by @dzbarsky in #4031
- Cleanup binary extension computation by @dzbarsky in #4033
- add docs for
go_deps.gazelle_default_attributes
by @tyler-french in #4021 - Tweak nogo archive handling by @dzbarsky in #4023
- Prefer rfind to rpartition in go_context by @dzbarsky in #4035
- Add qnx and osx platforms by @hofbi in #4036
- Move PATH env-var computation to GoContextInfo by @dzbarsky in #4037
- Turn source.cover into a depset by @dzbarsky in #4039
- Create shallower runfiles by @dzbarsky in #4040
- docs: add missing anchor to Bazel toolchains definition by @albertocavalcante in #4042
- Cleanup compilepkg flags handling by @dzbarsky in #4043
- GoSource can store dependent archives instead of full deps by @dzbarsky in #4041
- Remove some fields from Go context by @dzbarsky in #4034
- Optimize CcInfo computation by @dzbarsky in #4020
- Remove GoSource/GoLibrary from test/binary rules by @dzbarsky in #4044
- Remove orig_srcs by @dzbarsky in #4038
- Cleanup infer_importpath by @dzbarsky in #4047
- Cleanup importpath/importmap handling in go_context by @dzbarsky in #4052
- Remove cgo_exports ...
v0.50.1
WORKSPACE
code
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.23.0")
Fixes Included:
Full Changelog: v0.50.0...v0.50.1