Skip to content

Commit d1d3fa3

Browse files
committed
Tweak how we pass GOEXPERIMENT to actions
1 parent dfbf8b1 commit d1d3fa3

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

go/private/BUILD.sdk.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ filegroup(
4747
go_sdk(
4848
name = "go_sdk",
4949
srcs = [":srcs"],
50-
experiments = {experiments},
50+
experiments = "{experiments}",
5151
go = "bin/go{exe}",
5252
goarch = "{goarch}",
5353
goos = "{goos}",
@@ -62,9 +62,9 @@ go_sdk(
6262
go_tool_binary(
6363
name = "builder",
6464
srcs = ["@io_bazel_rules_go//go/tools/builders:builder_srcs"],
65+
exec_compatible_with = {exec_compatible_with},
6566
ldflags = "-X main.rulesGoStdlibPrefix={}".format(RULES_GO_STDLIB_PREFIX),
6667
sdk = ":go_sdk",
67-
exec_compatible_with = {exec_compatible_with},
6868
)
6969

7070
non_go_reset_target(

go/private/context.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def go_context(ctx, attr = None):
485485
env = {
486486
"GOARCH": mode.goarch,
487487
"GOOS": mode.goos,
488-
"GOEXPERIMENT": ",".join(toolchain.sdk.experiments),
488+
"GOEXPERIMENT": toolchain.sdk.experiments,
489489
"GOROOT": goroot,
490490
"GOROOT_FINAL": "GOROOT",
491491
"CGO_ENABLED": "0" if mode.pure else "1",

go/private/providers.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ GoSDK = provider(
4141
fields = {
4242
"goos": "The host OS the SDK was built for.",
4343
"goarch": "The host architecture the SDK was built for.",
44-
"experiments": "Go experiments to enable via GOEXPERIMENT.",
44+
"experiments": "Comma-separated Go experiments to enable via GOEXPERIMENT.",
4545
"root_file": "A file in the SDK root directory",
4646
"libs": ("List of pre-compiled .a files for the standard library " +
4747
"built for the execution platform."),

go/private/rules/sdk.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ go_sdk = rule(
4747
mandatory = True,
4848
doc = "The host architecture the SDK was built for",
4949
),
50-
"experiments": attr.string_list(
50+
"experiments": attr.string(
5151
mandatory = False,
52-
doc = "Go experiments to enable via GOEXPERIMENT",
52+
doc = "Comma-separated Go experiments to enable via GOEXPERIMENT",
5353
),
5454
"root_file": attr.label(
5555
mandatory = True,

go/private/sdk.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def _sdk_build_file(ctx, platform, version, experiments):
515515
"{goarch}": goarch,
516516
"{exe}": ".exe" if goos == "windows" else "",
517517
"{version}": version,
518-
"{experiments}": repr(experiments),
518+
"{experiments}": ",".join(experiments),
519519
"{exec_compatible_with}": repr([
520520
GOARCH_CONSTRAINTS[goarch],
521521
GOOS_CONSTRAINTS[goos],

0 commit comments

Comments
 (0)