Skip to content

Commit

Permalink
switch go toolchain on macos arch
Browse files Browse the repository at this point in the history
Differential Revision: D52911847

fbshipit-source-id: e5cc656a1e3591ad3febbf94ace31e2cc6077042
  • Loading branch information
Shayne Fletcher authored and facebook-github-bot committed Jan 19, 2024
1 parent df5ca92 commit 2d265ce
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions examples/no_prelude/toolchains/go_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def _download_toolchain(ctx: AnalysisContext):
def _toolchain_config():
version = "1.20.7"
os = host_info().os
arch = host_info().arch
if os.is_windows:
return struct(
sha256 = "736dc6c7fcab1c96b682c8c93e38d7e371e62a17d34cb2c37d451a1147f66af9",
Expand All @@ -88,13 +89,22 @@ def _toolchain_config():
version = version,
)
if os.is_macos:
return struct(
sha256 = "eea1e7e4c2f75c72629050e6a6c7c46c446d64056732a7787fb3ba16ace1982e",
platform = "darwin-arm64",
archive_extension = "tar.gz",
version = version,
)

if arch.is_aarch64:
return struct(
sha256 = "eea1e7e4c2f75c72629050e6a6c7c46c446d64056732a7787fb3ba16ace1982e",
platform = "darwin-arm64",
archive_extension = "tar.gz",
version = version,
)
elif arch.is_x86_64:
return struct(
sha256 = "785170eab380a8985d53896808b0a71336d0ea60e0a26099b4ccec77798b1cf4",
platform = "darwin-amd64",
archive_extension = "tar.gz",
version = version,
)
else:
fail("unrecognized architecture: couldn't select macOS go toolchain")
# Default linux
return struct(
sha256 = "f0a87f1bcae91c4b69f8dc2bc6d7e6bfcd7524fceec130af525058c0c17b1b44",
Expand Down

0 comments on commit 2d265ce

Please sign in to comment.