Skip to content

Commit

Permalink
sdk.bzl: include go.env since 1.21.0
Browse files Browse the repository at this point in the history
Include go.env file in the root of the sdk repo starting from Go 1.21.0.
  • Loading branch information
sluongng committed Aug 17, 2023
1 parent 139ec3c commit 94df77f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe

go_rules_dependencies()

go_register_toolchains(version = "1.20.7")
go_register_toolchains(version = "1.21.0")

http_archive(
name = "com_google_protobuf",
Expand Down
1 change: 1 addition & 0 deletions go/private/BUILD.sdk.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ filegroup(
"bin/go*",
"src/**",
"pkg/**",
{goenv}
]),
)

Expand Down
4 changes: 4 additions & 0 deletions go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ def _sdk_build_file(ctx, platform, version, experiments):
if not "nocoverageredesign" in experiments and not "coverageredesign" in experiments:
experiments = experiments + ["nocoverageredesign"]

# TODO(sluongng): Remove this once we drop support for Go 1.20
include_go_env = pv[1] >= 21

ctx.template(
"BUILD.bazel",
ctx.path(ctx.attr._sdk_build_file),
Expand All @@ -488,6 +491,7 @@ def _sdk_build_file(ctx, platform, version, experiments):
"{exe}": ".exe" if goos == "windows" else "",
"{version}": version,
"{experiments}": repr(experiments),
"{goenv}": "\"go.env\"," if include_go_env else "",
},
)

Expand Down

0 comments on commit 94df77f

Please sign in to comment.