Skip to content

Commit 1d59cd2

Browse files
authored
Prefer arm64 over aarch64 internally. NFC (#1246)
This seems like more commonly known/used name for the architecture these days.
1 parent c2260b4 commit 1d59cd2

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

emsdk.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,17 @@ def exit_with_error(msg):
141141
elif machine.endswith('86'):
142142
ARCH = 'x86'
143143
elif machine.startswith('aarch64') or machine.lower().startswith('arm64'):
144-
ARCH = 'aarch64'
144+
if WINDOWS:
145+
errlog('No support for Windows on Arm, fallback to x64')
146+
ARCH = 'x86_64'
147+
else:
148+
ARCH = 'arm64'
145149
elif machine.startswith('arm'):
146150
ARCH = 'arm'
147151
else:
148152
exit_with_error('unknown machine architecture: ' + machine)
149153

154+
150155
# Don't saturate all cores to not steal the whole system, but be aggressive.
151156
CPU_CORES = int(os.getenv('EMSDK_NUM_CORES', max(multiprocessing.cpu_count() - 1, 1)))
152157

@@ -254,7 +259,7 @@ def vswhere(version):
254259
program_files = os.environ['ProgramFiles']
255260
vswhere_path = os.path.join(program_files, 'Microsoft Visual Studio', 'Installer', 'vswhere.exe')
256261
# Source: https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
257-
tools_arch = 'ARM64' if ARCH == 'aarch64' else 'x86.x64'
262+
tools_arch = 'ARM64' if ARCH == 'arm64' else 'x86.x64'
258263
# The "-products *" allows detection of Build Tools, the "-prerelease" allows detection of Preview version
259264
# of Visual Studio and Build Tools.
260265
output = json.loads(subprocess.check_output([vswhere_path, '-latest', '-products', '*', '-prerelease', '-version', '[%s.0,%s.0)' % (version, version + 1), '-requires', 'Microsoft.VisualStudio.Component.VC.Tools.' + tools_arch, '-property', 'installationPath', '-format', 'json']))
@@ -1018,13 +1023,13 @@ def xcode_sdk_version():
10181023
def cmake_target_platform(tool):
10191024
# Source: https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html#platform-selection
10201025
if hasattr(tool, 'arch'):
1021-
if tool.arch == 'aarch64':
1026+
if tool.arch == 'arm64':
10221027
return 'ARM64'
10231028
elif tool.arch == 'x86_64':
10241029
return 'x64'
10251030
elif tool.arch == 'x86':
10261031
return 'Win32'
1027-
if ARCH == 'aarch64':
1032+
if ARCH == 'arm64':
10281033
return 'ARM64'
10291034
else:
10301035
return 'x64' if tool.bitness == 64 else 'Win32'
@@ -1033,7 +1038,7 @@ def cmake_target_platform(tool):
10331038
def cmake_host_platform():
10341039
# Source: https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html#toolset-selection
10351040
arch_to_cmake_host_platform = {
1036-
'aarch64': 'ARM64',
1041+
'arm64': 'ARM64',
10371042
'arm': 'ARM',
10381043
'x86_64': 'x64',
10391044
'x86': 'x86'
@@ -1078,7 +1083,7 @@ def build_llvm(tool):
10781083
targets_to_build = 'WebAssembly;X86'
10791084
elif ARCH == 'arm':
10801085
targets_to_build = 'WebAssembly;ARM'
1081-
elif ARCH == 'aarch64':
1086+
elif ARCH == 'arm64':
10821087
targets_to_build = 'WebAssembly;AArch64'
10831088
else:
10841089
targets_to_build = 'WebAssembly'
@@ -1860,10 +1865,6 @@ def install_tool(self):
18601865
elif hasattr(self, 'git_branch'):
18611866
success = git_clone_checkout_and_pull(url, self.installation_path(), self.git_branch)
18621867
elif url.endswith(ARCHIVE_SUFFIXES):
1863-
global ARCH
1864-
if WINDOWS and ARCH == 'aarch64':
1865-
errlog('No support for Windows on Arm, fallback to x64')
1866-
ARCH = 'x86_64'
18671868
success = download_and_unzip(url, self.installation_path(), filename_prefix=getattr(self, 'zipfile_prefix', ''))
18681869
else:
18691870
assert False, 'unhandled url type: ' + url
@@ -2010,7 +2011,7 @@ def find_latest_hash():
20102011

20112012
def resolve_sdk_aliases(name, verbose=False):
20122013
releases_info = load_releases_info()
2013-
if name == 'latest' and LINUX and ARCH == 'aarch64':
2014+
if name == 'latest' and LINUX and ARCH == 'arm64':
20142015
print("warning: 'latest' on arm64-linux may be slightly behind other architectures")
20152016
name = 'latest-arm64-linux'
20162017
while name in releases_info['aliases']:
@@ -2058,7 +2059,7 @@ def get_emscripten_releases_tot():
20582059
# may not be a build for the most recent ones yet; find the last
20592060
# that does.
20602061
arch = ''
2061-
if ARCH == 'aarch64':
2062+
if ARCH == 'arm64':
20622063
arch = '-arm64'
20632064
for release in recent_releases:
20642065
url = emscripten_releases_download_url_template % (

emsdk_manifest.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"id": "releases",
4848
"version": "%releases-tag%",
4949
"bitness": 64,
50-
"arch": "aarch64",
50+
"arch": "arm64",
5151
"macos_url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/%releases-tag%/wasm-binaries-arm64.tbz2",
5252
"linux_url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/%releases-tag%/wasm-binaries-arm64.tbz2",
5353
"zipfile_prefix": "%releases-tag%-",
@@ -96,7 +96,7 @@
9696
{
9797
"id": "node",
9898
"version": "8.9.1",
99-
"arch": "aarch64",
99+
"arch": "arm64",
100100
"bitness": 64,
101101
"linux_url": "node-v8.9.1-linux-arm64.tar.xz",
102102
"activated_path": "%installation_dir%/bin",
@@ -142,7 +142,7 @@
142142
{
143143
"id": "node",
144144
"version": "12.18.1",
145-
"arch": "aarch64",
145+
"arch": "arm64",
146146
"bitness": 64,
147147
"linux_url": "node-v12.18.1-linux-arm64.tar.xz",
148148
"activated_path": "%installation_dir%/bin",
@@ -190,7 +190,7 @@
190190
{
191191
"id": "node",
192192
"version": "14.18.2",
193-
"arch": "aarch64",
193+
"arch": "arm64",
194194
"bitness": 64,
195195
"macos_url": "node-v14.18.2-darwin-x64.tar.gz",
196196
"linux_url": "node-v14.18.2-linux-arm64.tar.xz",
@@ -239,7 +239,7 @@
239239
{
240240
"id": "node",
241241
"version": "14.15.5",
242-
"arch": "aarch64",
242+
"arch": "arm64",
243243
"bitness": 64,
244244
"macos_url": "node-v14.15.5-darwin-x64.tar.gz",
245245
"linux_url": "node-v14.15.5-linux-arm64.tar.xz",
@@ -288,7 +288,7 @@
288288
{
289289
"id": "node",
290290
"version": "15.14.0",
291-
"arch": "aarch64",
291+
"arch": "arm64",
292292
"bitness": 64,
293293
"macos_url": "node-v15.14.0-darwin-x64.tar.gz",
294294
"linux_url": "node-v15.14.0-linux-arm64.tar.xz",
@@ -336,7 +336,7 @@
336336
{
337337
"id": "node",
338338
"version": "16.20.0",
339-
"arch": "aarch64",
339+
"arch": "arm64",
340340
"bitness": 64,
341341
"macos_url": "node-v16.20.0-darwin-arm64.tar.gz",
342342
"linux_url": "node-v16.20.0-linux-arm64.tar.xz",
@@ -448,7 +448,7 @@
448448
"id": "python",
449449
"version": "3.9.2",
450450
"bitness": 64,
451-
"arch": "aarch64",
451+
"arch": "arm64",
452452
"macos_url": "python-3.9.2-1-macos-arm64.tar.gz",
453453
"activated_cfg": "PYTHON='%installation_dir%/bin/python3'",
454454
"activated_env": "EMSDK_PYTHON=%installation_dir%/bin/python3;SSL_CERT_FILE=%installation_dir%/lib/python3.9/site-packages/certifi/cacert.pem"
@@ -691,7 +691,7 @@
691691
"bitness": 64,
692692
"uses": ["node-16.20.0-64bit", "python-3.9.2-64bit", "releases-%releases-tag%-64bit"],
693693
"os": "macos",
694-
"arch": "aarch64",
694+
"arch": "arm64",
695695
"custom_install_script": "emscripten_npm_install"
696696
},
697697
{

0 commit comments

Comments
 (0)