Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down