diff --git a/go/private/platforms.bzl b/go/private/platforms.bzl index ee2c7accba..21a62e90da 100644 --- a/go/private/platforms.bzl +++ b/go/private/platforms.bzl @@ -83,6 +83,7 @@ GOOS_GOARCH = ( ("windows", "386"), ("windows", "amd64"), ("windows", "arm"), + ("windows", "arm64"), ) RACE_GOOS_GOARCH = { @@ -135,6 +136,7 @@ CGO_GOOS_GOARCH = { ("solaris", "amd64"): None, ("windows", "386"): None, ("windows", "amd64"): None, + ("windows", "arm64"): None, } def _generate_constraints(names, bazel_constraints): diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl index 7c73c116ee..4189d81989 100644 --- a/go/private/sdk.bzl +++ b/go/private/sdk.bzl @@ -276,7 +276,11 @@ def _detect_host_platform(ctx): # Default to amd64 when uname doesn't return a known value. elif ctx.os.name.startswith("windows"): - goos, goarch = "windows", "amd64" + goos = "windows" + if ctx.os.environ.get("PROCESSOR_ARCHITECTURE") == "ARM64" or ctx.os.environ.get("PROCESSOR_ARCHITEW6432") == "ARM64": + goarch = "arm64" + else: + goarch = "amd64" elif ctx.os.name == "freebsd": goos, goarch = "freebsd", "amd64" else: