Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MINIMUM_NODE_VERSION to 10.19.0 and add testing #18465

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 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 a specific 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 @@ -508,11 +518,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 @@ -523,10 +533,17 @@ jobs:
command: git submodule update --init
- pip-install
- build
- setup-latest-node
# Run some basic tests with the minimum version of node that we currently
# support.
- install-node-version:
node_version: "10.19.0"
- run-tests:
test_targets: "core2.test_hello_world"
# Run a few test with the most recent version of node
# In particular we have some tests that require node flags on older
# versions of node but not with the most recent version.
- 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.
test_targets: "-v core2.test_pthread_create core2.test_i64_invoke_bigint core2.test_source_map"
- upload-test-results
test-other:
Expand Down Expand Up @@ -703,7 +720,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
25 changes: 16 additions & 9 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,22 @@ def setUp(self):
self.settings_mods = {}
self.emcc_args = ['-Wclosure', '-Werror', '-Wno-limited-postlink-optimizations']
self.ldflags = []
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',
]
# Increate stack trace limit to maximise usefulness of test failure reports
self.node_args = ['--stack-trace-limit=50']

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=throw')

self.v8_args = ['--wasm-staging']
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 distinct
# from the minimum version required to execute the generated code. This is not an
# exact requirement, but is the oldest version of node that we do any testing with.
# This version aligns with the 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