[sdk] Use os.uname() to figure out the host architecture on macOS

platform.machine() might return x86_64 if run under rosetta causing the
script to assume that we're building x64 instead of arm64.

Change-Id: I169890f41ca71b08f3068da609cbe0579743051b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202770
Reviewed-by: William Hesse <whesse@google.com>
This commit is contained in:
Alexander Thomas 2021-06-08 15:40:10 +00:00
parent daf16471cc
commit a87ea2b474

View file

@ -24,7 +24,8 @@ def BuildArchitectures():
if BUILD_OS == 'linux':
return ['ia32', 'x64', 'arm', 'arm64']
elif BUILD_OS == 'macos':
return [BUILD_ARCHITECTURE]
arch = 'arm64' if 'arm64' == os.uname().machine else 'x64'
return [arch]
else:
return ['ia32', 'x64']