Skip to content

Commit

Permalink
Undo API-breaking change to go_sdk experiments attribute (#4210)
Browse files Browse the repository at this point in the history
**What type of PR is this?**

Bug fix, see
#4022 (comment)

**What does this PR do? Why is it needed?**

Reverts the behavior to the API while keeping the optimization

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**
  • Loading branch information
dzbarsky authored Jan 2, 2025
1 parent 1cfb0e2 commit f53a3f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions go/private/rules/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _go_sdk_impl(ctx):
return [GoSDK(
goos = ctx.attr.goos,
goarch = ctx.attr.goarch,
experiments = ctx.attr.experiments,
experiments = ",".join(ctx.attr.experiments),
root_file = ctx.file.root_file,
package_list = package_list,
libs = depset(ctx.files.libs),
Expand All @@ -47,9 +47,9 @@ go_sdk = rule(
mandatory = True,
doc = "The host architecture the SDK was built for",
),
"experiments": attr.string(
"experiments": attr.string_list(
mandatory = False,
doc = "Comma-separated Go experiments to enable via GOEXPERIMENT",
doc = "Go experiments to enable via GOEXPERIMENT",
),
"root_file": attr.label(
mandatory = True,
Expand Down
2 changes: 1 addition & 1 deletion go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def _sdk_build_file(ctx, platform, version, experiments):
"{goarch}": goarch,
"{exe}": ".exe" if goos == "windows" else "",
"{version}": version,
"{experiments}": repr(",".join(experiments)),
"{experiments}": repr(experiments),
"{exec_compatible_with}": repr([
GOARCH_CONSTRAINTS[goarch],
GOOS_CONSTRAINTS[goos],
Expand Down

0 comments on commit f53a3f7

Please sign in to comment.