Skip to content

Commit d7327b4

Browse files
authored
Update node, 15.14.0 -> 16.20.0 (#1232)
This allows us to use the native ARM64 version on MacOS. Also update the test scripts to work on ARM64 mac, and skip tests that aren't relevant.
1 parent 775ba04 commit d7327b4

File tree

6 files changed

+119
-34
lines changed

6 files changed

+119
-34
lines changed

.circleci/config.yml

+38-11
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,39 @@ executors:
1010
mac:
1111
environment:
1212
EMSDK_NOTTY: "1"
13-
# Without this, any `brew installl` command will result in self-update of
13+
# Without this, any `brew install` command will result in self-update of
1414
# brew itself which takes more than 4 minutes.
1515
HOMEBREW_NO_AUTO_UPDATE: "1"
1616
macos:
1717
xcode: "12.5.1"
1818
resource_class: macos.x86.medium.gen2
19+
mac_arm64:
20+
environment:
21+
EMSDK_NOTTY: "1"
22+
# Without this, any `brew install` command will result in self-update of
23+
# brew itself which takes more than 4 minutes.
24+
HOMEBREW_NO_AUTO_UPDATE: "1"
25+
macos:
26+
xcode: "13.4.1"
27+
resource_class: macos.m1.medium.gen1
28+
29+
commands:
30+
setup-macos:
31+
steps:
32+
- checkout
33+
- run:
34+
name: Install CMake
35+
command: brew install cmake
36+
test-macos:
37+
steps:
38+
- run:
39+
name: test.sh
40+
command: test/test.sh
41+
- run:
42+
name: test.py
43+
command: |
44+
source emsdk_env.sh
45+
test/test.py
1946
2047
jobs:
2148
flake8:
@@ -59,16 +86,13 @@ jobs:
5986
test-mac:
6087
executor: mac
6188
steps:
62-
- checkout
63-
- run:
64-
name: Install cmake
65-
command: brew install cmake
66-
- run: test/test.sh
67-
- run:
68-
name: test.py
69-
command: |
70-
source emsdk_env.sh
71-
test/test.py
89+
- setup-macos
90+
- test-macos
91+
test-mac-arm64:
92+
executor: mac_arm64
93+
steps:
94+
- setup-macos
95+
- test-macos
7296
test-windows:
7397
executor:
7498
name: win/vs2019
@@ -236,6 +260,9 @@ workflows:
236260
test-mac:
237261
jobs:
238262
- test-mac
263+
test-mac-arm64:
264+
jobs:
265+
- test-mac-arm64
239266
test-windows:
240267
jobs:
241268
- test-windows

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ COPY --from=stage_build /emsdk /emsdk
6262
# This will let use tools offered by this image inside other Docker images
6363
# (sub-stages) or with custom / no entrypoint
6464
ENV EMSDK=/emsdk \
65-
PATH="/emsdk:/emsdk/upstream/emscripten:/emsdk/upstream/bin:/emsdk/node/15.14.0_64bit/bin:${PATH}"
65+
PATH="/emsdk:/emsdk/upstream/emscripten:/emsdk/upstream/bin:/emsdk/node/16.20.0_64bit/bin:${PATH}"
6666

6767
# ------------------------------------------------------------------------------
6868
# Create a 'standard` 1000:1000 user

emsdk_manifest.json

+55-7
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,54 @@
298298
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
299299
},
300300

301+
{
302+
"id": "node",
303+
"version": "16.20.0",
304+
"bitness": 32,
305+
"arch": "x86",
306+
"windows_url": "node-v16.20.0-win-x86.zip",
307+
"activated_path": "%installation_dir%/bin",
308+
"activated_path_skip": "node",
309+
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
310+
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
311+
},
312+
{
313+
"id": "node",
314+
"version": "16.20.0",
315+
"arch": "arm",
316+
"bitness": 32,
317+
"linux_url": "node-v16.20.0-linux-armv7l.tar.xz",
318+
"activated_path": "%installation_dir%/bin",
319+
"activated_path_skip": "node",
320+
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
321+
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
322+
},
323+
{
324+
"id": "node",
325+
"version": "16.20.0",
326+
"bitness": 64,
327+
"arch": "x86_64",
328+
"macos_url": "node-v16.20.0-darwin-x64.tar.gz",
329+
"windows_url": "node-v16.20.0-win-x64.zip",
330+
"linux_url": "node-v16.20.0-linux-x64.tar.xz",
331+
"activated_path": "%installation_dir%/bin",
332+
"activated_path_skip": "node",
333+
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
334+
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
335+
},
336+
{
337+
"id": "node",
338+
"version": "16.20.0",
339+
"arch": "aarch64",
340+
"bitness": 64,
341+
"macos_url": "node-v16.20.0-darwin-arm64.tar.gz",
342+
"linux_url": "node-v16.20.0-linux-arm64.tar.xz",
343+
"activated_path": "%installation_dir%/bin",
344+
"activated_path_skip": "node",
345+
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
346+
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
347+
},
348+
301349

302350
{
303351
"id": "python",
@@ -602,19 +650,19 @@
602650
{
603651
"version": "main",
604652
"bitness": 64,
605-
"uses": ["python-3.9.2-nuget-64bit", "llvm-git-main-64bit", "node-15.14.0-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
653+
"uses": ["python-3.9.2-nuget-64bit", "llvm-git-main-64bit", "node-16.20.0-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
606654
"os": "win"
607655
},
608656
{
609657
"version": "main",
610658
"bitness": 64,
611-
"uses": ["python-3.9.2-64bit", "llvm-git-main-64bit", "node-15.14.0-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
659+
"uses": ["python-3.9.2-64bit", "llvm-git-main-64bit", "node-16.20.0-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
612660
"os": "macos"
613661
},
614662
{
615663
"version": "main",
616664
"bitness": 64,
617-
"uses": ["llvm-git-main-64bit", "node-15.14.0-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
665+
"uses": ["llvm-git-main-64bit", "node-16.20.0-64bit", "emscripten-main-64bit", "binaryen-main-64bit"],
618666
"os": "linux"
619667
},
620668
{
@@ -626,30 +674,30 @@
626674
{
627675
"version": "releases-%releases-tag%",
628676
"bitness": 64,
629-
"uses": ["node-15.14.0-64bit", "releases-%releases-tag%-64bit"],
677+
"uses": ["node-16.20.0-64bit", "releases-%releases-tag%-64bit"],
630678
"os": "linux",
631679
"custom_install_script": "emscripten_npm_install"
632680
},
633681
{
634682
"version": "releases-%releases-tag%",
635683
"bitness": 64,
636-
"uses": ["node-15.14.0-64bit", "python-3.9.2-64bit", "releases-%releases-tag%-64bit"],
684+
"uses": ["node-16.20.0-64bit", "python-3.9.2-64bit", "releases-%releases-tag%-64bit"],
637685
"os": "macos",
638686
"arch": "x86_64",
639687
"custom_install_script": "emscripten_npm_install"
640688
},
641689
{
642690
"version": "releases-%releases-tag%",
643691
"bitness": 64,
644-
"uses": ["node-15.14.0-64bit", "python-3.9.2-64bit", "releases-%releases-tag%-64bit"],
692+
"uses": ["node-16.20.0-64bit", "python-3.9.2-64bit", "releases-%releases-tag%-64bit"],
645693
"os": "macos",
646694
"arch": "aarch64",
647695
"custom_install_script": "emscripten_npm_install"
648696
},
649697
{
650698
"version": "releases-%releases-tag%",
651699
"bitness": 64,
652-
"uses": ["node-15.14.0-64bit", "python-3.9.2-nuget-64bit", "java-8.152-64bit", "releases-%releases-tag%-64bit"],
700+
"uses": ["node-16.20.0-64bit", "python-3.9.2-nuget-64bit", "java-8.152-64bit", "releases-%releases-tag%-64bit"],
653701
"os": "win",
654702
"custom_install_script": "emscripten_npm_install"
655703
}

scripts/update_node.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
import os
1717
import shutil
1818

19-
version = '15.14.0'
20-
base = 'https://nodejs.org/dist/latest-v15.x/'
19+
version = '16.20.0'
20+
base = 'https://nodejs.org/dist/latest-v16.x/'
2121
upload_base = 'gs://webassembly/emscripten-releases-builds/deps/'
2222

2323
suffixes = [
2424
'-win-x86.zip',
2525
'-win-x64.zip',
2626
'-darwin-x64.tar.gz',
27+
'-darwin-arm64.tar.gz',
2728
'-linux-x64.tar.xz',
2829
'-linux-arm64.tar.xz',
2930
'-linux-armv7l.tar.xz',

test/test.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
import json
33
import os
4+
import platform
45
import shutil
56
import subprocess
67
import sys
@@ -9,6 +10,7 @@
910

1011
WINDOWS = sys.platform.startswith('win')
1112
MACOS = sys.platform == 'darwin'
13+
MACOS_ARM64 = MACOS and platform.machine() == 'arm64'
1214

1315
emconfig = os.path.abspath('.emscripten')
1416
assert os.path.exists(emconfig)
@@ -197,13 +199,17 @@ def test_closure(self):
197199
check_call(upstream_emcc + ' hello_world.c --closure=1')
198200

199201
def test_specific_version(self):
202+
if MACOS_ARM64:
203+
self.skipTest('Old sdk versions do not have ARM64 binaries')
200204
print('test specific release (new, short name)')
201205
run_emsdk('install 1.38.33')
202206
print('another install, but no need for re-download')
203207
checked_call_with_output(emsdk + ' install 1.38.33', expected='Skipped', unexpected='Downloading:')
204208
run_emsdk('activate 1.38.33')
205209

206210
def test_specific_version_full(self):
211+
if MACOS_ARM64:
212+
self.skipTest('Old sdk versions do not have ARM64 binaries')
207213
print('test specific release (new, full name)')
208214
run_emsdk('install sdk-1.38.33-64bit')
209215
run_emsdk('activate sdk-1.38.33-64bit')
@@ -220,7 +226,8 @@ def test_binaryen_from_source(self):
220226
def test_no_32bit(self):
221227
print('test 32-bit error')
222228
emsdk_hacked = hack_emsdk('not is_os_64bit()', 'True')
223-
failing_call_with_output('python %s install latest' % emsdk_hacked, 'this tool is only provided for 64-bit OSes')
229+
failing_call_with_output('%s %s install latest' % (sys.executable, emsdk_hacked),
230+
'this tool is only provided for 64-bit OSes')
224231
os.remove(emsdk_hacked)
225232

226233
def test_update_no_git(self):
@@ -243,10 +250,10 @@ def test_update_no_git(self):
243250

244251
def test_install_arbitrary(self):
245252
# Test that its possible to install arbrary emscripten-releases SDKs
246-
run_emsdk('install 5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2')
253+
run_emsdk('install 1b7f7bc6002a3ca73647f41fc10e1fac7f06f804')
247254

248255
# Check that its not re-downloaded
249-
checked_call_with_output(emsdk + ' install 5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2', expected='Skipped', unexpected='Downloading:')
256+
checked_call_with_output(emsdk + ' install 1b7f7bc6002a3ca73647f41fc10e1fac7f06f804', expected='Skipped', unexpected='Downloading:')
250257

251258
def test_install_tool(self):
252259
# Test that its possible to install emscripten as tool instead of SDK

test/test.sh

+12-10
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@ set -e
77

88
# Test that arbitrary (non-released) versions can be installed and
99
# activated.
10-
./emsdk install sdk-upstream-5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2
11-
./emsdk activate sdk-upstream-5c776e6a91c0cb8edafca16a652ee1ee48f4f6d2
10+
./emsdk install sdk-upstream-1b7f7bc6002a3ca73647f41fc10e1fac7f06f804
11+
./emsdk activate sdk-upstream-1b7f7bc6002a3ca73647f41fc10e1fac7f06f804
1212
source ./emsdk_env.sh
1313
which emcc
1414
emcc -v
1515

16-
# Install an older version of the SDK that requires EM_CACHE to be
17-
# set in the environment, so that we can test it is later removed
18-
./emsdk install sdk-1.39.15
19-
./emsdk activate sdk-1.39.15
20-
source ./emsdk_env.sh
21-
which emcc
22-
emcc -v
23-
test -n "$EM_CACHE"
16+
if [[ $(uname -m) == "x86_64" ]]; then
17+
# Install an older version of the SDK that requires EM_CACHE to be
18+
# set in the environment, so that we can test it is later removed
19+
./emsdk install sdk-1.39.15
20+
./emsdk activate sdk-1.39.15
21+
source ./emsdk_env.sh
22+
which emcc
23+
emcc -v
24+
test -n "$EM_CACHE"
25+
fi
2426

2527
# Install the latest version of the SDK which is the expected precondition
2628
# of test.py.

0 commit comments

Comments
 (0)