diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl index 62cee75704..fc1d6a00b0 100644 --- a/go/private/sdk.bzl +++ b/go/private/sdk.bzl @@ -25,13 +25,14 @@ go_host_sdk = repository_rule(_go_host_sdk_impl, environ = ["GOROOT"]) def _go_download_sdk_impl(ctx): if ctx.os.name == 'linux': + host = "linux_amd64" res = ctx.execute(['uname', '-p']) - if res.return_code == 0 and res.stdout == 's390x': - host = "linux_s390x" - else: - # uname -p, -i, and -m can return wildly different values on different - # distributions and versions. Always default to amd64. - host = "linux_amd64" + if res.return_code == 0: + if res.stdout == 's390x': + host = "linux_s390x" + elif res.stdout == 'ppc64le': + host = "linux_ppc64le" + # Default to amd64 when uname doesn't return a known value. elif ctx.os.name == 'mac os x': host = "darwin_amd64" elif ctx.os.name.startswith('windows'):