Skip to content

Commit

Permalink
Update MINIMUM_NODE_VERSION to 10.19.0 and add testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Jan 4, 2023
1 parent 954971d commit 59f2a81
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 19 deletions.
38 changes: 27 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,30 @@ commands:
- run:
name: pip install
command: << parameters.python >> -m pip install -r requirements-dev.txt
setup-latest-node:
description: "setup latest node"
install-node-version:
description: "install speific version of node"
parameters:
node_version:
description: "version of node to install"
type: string
steps:
- run:
name: setup latest node
name: setup node v<< parameters.node_version >>
command: |
cd $HOME
wget https://nodejs.org/dist/v19.0.0/node-v19.0.0-linux-x64.tar.xz
tar xf node-v19.0.0-linux-x64.tar.xz
echo "NODE_JS = [os.path.expanduser('~/node-v19.0.0-linux-x64/bin/node')]" >> ~/emsdk/.emscripten
version=<< parameters.node_version >>
wget https://nodejs.org/dist/v${version}/node-v${version}-linux-x64.tar.xz
tar xf node-v${version}-linux-x64.tar.xz
echo "NODE_JS = [os.path.expanduser('~/node-v${version}-linux-x64/bin/node')]" >> ~/emsdk/.emscripten
echo "JS_ENGINES = [NODE_JS]" >> ~/emsdk/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> ~/emsdk/.emscripten
cat ~/emsdk/.emscripten
echo "export PATH=\"$HOME/node-v19.0.0-linux-x64/bin:\$PATH\"" >> $BASH_ENV
echo "export PATH=\"$HOME/node-v${version}-linux-x64/bin:\$PATH\"" >> $BASH_ENV
install-latest-node:
description: "install latest version of node"
steps:
- install-node-version:
node_version: "19.0.0"
install-v8:
description: "install v8 using jsvu"
steps:
Expand Down Expand Up @@ -511,11 +521,11 @@ jobs:
test_targets: "wasm64_v8"
- run-tests:
test_targets: "wasm64l"
- setup-latest-node
- install-latest-node
- run-tests:
test_targets: "wasm64"
- upload-test-results
test-latest-node:
test-node-compat:
# We don't use `bionic` here since its tool old to run recent node versions:
# `/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found`
executor: linux-python
Expand All @@ -526,7 +536,13 @@ jobs:
command: git submodule update --init
- pip-install
- build
- setup-latest-node
- install-node-version:
node_version: "10.19.0"
- run-tests:
# Run some basic tests to ensure JS compiler and other tools run
# on this older version.
test_targets: "core2.test_hello_world"
- install-latest-node
- run-tests:
# Run tests that on older versions of node would require flags, but
# those flags should not be injected on newer versions.
Expand Down Expand Up @@ -706,7 +722,7 @@ workflows:
- test-sockets-chrome:
requires:
- build-linux
- test-latest-node
- test-node-compat
- test-windows
- test-mac:
# The mac tester also uses the libraries built on the linux builder to
Expand Down
2 changes: 1 addition & 1 deletion src/parseTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Tests live in test/other/test_parseTools.js.
*/

globalThis.FOUR_GB = 4 * 1024 * 1024 * 1024;
global.FOUR_GB = 4 * 1024 * 1024 * 1024;
const FLOAT_TYPES = new Set(['float', 'double']);

let currentlyParsedFilename = '';
Expand Down
18 changes: 14 additions & 4 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,22 @@ def setUp(self):
self.node_args = [
# Increate stack trace limit to maximise usefulness of test failure reports
'--stack-trace-limit=50',
# Opt in to node v15 default behaviour:
# https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
'--unhandled-rejections=throw',
# Include backtrace for all uncuaght exceptions (not just Error).
'--trace-uncaught',
]

node_version = shared.check_node_version()
if node_version:
if node_version < (11, 0, 0):
self.node_args.append('--unhandled-rejections=strict')
self.node_args.append('--experimental-wasm-se')
else:
# Include backtrace for all uncuaght exceptions (not just Error).
self.node_args.append('--trace-uncaught')
if node_version < (15, 0, 0):
# Opt in to node v15 default behaviour:
# https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
self.node_args.append('--unhandled-rejections=strict')

self.v8_args = []
self.env = {}
self.temp_files_before_run = []
Expand Down
5 changes: 3 additions & 2 deletions test/test_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,9 @@ def test_node(self):

for version, succeed in [('v0.8.0', False),
('v4.1.0', False),
('v4.1.1', True),
('v4.2.3-pre', True),
('v10.18.0', False),
('v10.19.0', True),
('v10.19.1-pre', True),
('cheez', False)]:
print(version, succeed)
delete_file(SANITY_FILE)
Expand Down
6 changes: 5 additions & 1 deletion tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@


DEBUG_SAVE = DEBUG or int(os.environ.get('EMCC_DEBUG_SAVE', '0'))
MINIMUM_NODE_VERSION = (4, 1, 1)
# Minimum node version required to run the emscripten compiler. This is distict
# from minimum version of node required to execute the generted code.
# This is not a hard requirement, but is the oldest version of node that we
# any testing with. This version aligns with current Ubuuntu TLS 20.04 (Focal).
MINIMUM_NODE_VERSION = (10, 19, 0)
EXPECTED_LLVM_VERSION = "16.0"

# Used only when EM_PYTHON_MULTIPROCESSING=1 env. var is set.
Expand Down

0 comments on commit 59f2a81

Please sign in to comment.