Skip to content

Commit db94744

Browse files
authored
Rename host_go{arch,os} to exec_ (#4525)
This is technically more correct as these may be selected on non-host exec platforms
1 parent 25f9eca commit db94744

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

go/private/BUILD.sdk.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ package_list(
109109

110110
declare_go_toolchains(
111111
builder = ":builder_reset",
112-
host_goos = "{goos}",
112+
exec_goos = "{goos}",
113113
pack = ":pack_reset",
114114
sdk = ":go_sdk",
115115
)

go/private/go_toolchain.bzl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ go_toolchain = rule(
9696
provides = [platform_common.ToolchainInfo],
9797
)
9898

99-
def declare_go_toolchains(host_goos, sdk, builder, pack):
99+
def declare_go_toolchains(exec_goos, sdk, builder, pack):
100100
"""Declares go_toolchain targets for each platform."""
101101
for p in PLATFORMS:
102102
if p.cgo:
@@ -107,9 +107,9 @@ def declare_go_toolchains(host_goos, sdk, builder, pack):
107107

108108
link_flags = []
109109
cgo_link_flags = []
110-
if host_goos == "darwin":
110+
if exec_goos == "darwin":
111111
cgo_link_flags.extend(["-shared", "-Wl,-all_load"])
112-
if host_goos == "linux":
112+
elif exec_goos == "linux":
113113
cgo_link_flags.append("-Wl,-whole-archive")
114114

115115
go_toolchain(
@@ -128,8 +128,8 @@ def declare_go_toolchains(host_goos, sdk, builder, pack):
128128
def declare_bazel_toolchains(
129129
*,
130130
go_toolchain_repo,
131-
host_goarch,
132-
host_goos,
131+
exec_goarch,
132+
exec_goos,
133133
major,
134134
minor,
135135
patch,
@@ -260,8 +260,8 @@ def declare_bazel_toolchains(
260260
name = prefix + "go_" + p.name,
261261
toolchain_type = GO_TOOLCHAIN,
262262
exec_compatible_with = [
263-
"@io_bazel_rules_go//go/toolchain:" + host_goos,
264-
"@io_bazel_rules_go//go/toolchain:" + host_goarch,
263+
"@io_bazel_rules_go//go/toolchain:" + exec_goos,
264+
"@io_bazel_rules_go//go/toolchain:" + exec_goarch,
265265
],
266266
target_compatible_with = constraints,
267267
target_settings = [

go/private/sdk.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def go_toolchains_single_definition(ctx, *, prefix, goos, goarch, sdk_repo, sdk_
211211
chunks.append("""declare_bazel_toolchains(
212212
prefix = "{prefix}",
213213
go_toolchain_repo = "@{sdk_repo}",
214-
host_goarch = "{goarch}",
215-
host_goos = "{goos}",
214+
exec_goarch = "{goarch}",
215+
exec_goos = "{goos}",
216216
major = {identifier_prefix}MAJOR_VERSION,
217217
minor = {identifier_prefix}MINOR_VERSION,
218218
patch = {identifier_prefix}PATCH_VERSION,

tests/core/starlark/sdk_tests.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ _123_PREFIX_PRERELEASE_SUFFIX = "rc1"
2424
"""declare_bazel_toolchains(
2525
prefix = "123_prefix_",
2626
go_toolchain_repo = "@sdk_repo",
27-
host_goarch = "amd64",
28-
host_goos = "linux",
27+
exec_goarch = "amd64",
28+
exec_goos = "linux",
2929
major = _123_PREFIX_MAJOR_VERSION,
3030
minor = _123_PREFIX_MINOR_VERSION,
3131
patch = _123_PREFIX_PATCH_VERSION,
@@ -64,8 +64,8 @@ def _go_toolchains_single_definition_without_version_test(ctx):
6464
"""declare_bazel_toolchains(
6565
prefix = "123_prefix_",
6666
go_toolchain_repo = "@sdk_repo",
67-
host_goarch = "amd64",
68-
host_goos = "linux",
67+
exec_goarch = "amd64",
68+
exec_goos = "linux",
6969
major = _123_PREFIX_MAJOR_VERSION,
7070
minor = _123_PREFIX_MINOR_VERSION,
7171
patch = _123_PREFIX_PATCH_VERSION,

0 commit comments

Comments
 (0)