Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8cfa9d1
chore: Upgrade support to node 22 and 24
kmruiz Oct 27, 2025
687c75b
chore: use devtools toolchain on linux and upgrade macos deps
kmruiz Oct 27, 2025
1062b93
chore: change display name, it's misleading
kmruiz Oct 27, 2025
8254b4c
chore: add brotli as a dependency when compiling the test
kmruiz Oct 30, 2025
a695c62
chore: reuse devtools toolchain in Linux
kmruiz Oct 30, 2025
9649c4c
chore: fix typo
kmruiz Oct 30, 2025
6bfb4c5
chore: simplify by using a stable folder after installation
kmruiz Oct 30, 2025
5771991
chore: Remove unsupported flags for r/o heaps
kmruiz Oct 30, 2025
6a13147
chore: fix check in OSX
kmruiz Oct 30, 2025
d46ce11
chore: use 22 until we have 24
kmruiz Oct 31, 2025
059accd
chore: create parent node folder, necessary for the symlink
kmruiz Oct 31, 2025
0c32538
chore: upgrade node-gyp to the latest
kmruiz Oct 31, 2025
f3fbc0a
chore: upgrade test template to node 24 and std=c++20
kmruiz Oct 31, 2025
eb955bd
chore: remove assert(CanUseCustomSnapshotPerIsolate)
kmruiz Oct 31, 2025
59714b3
chore: forgot to remove the test skip
kmruiz Oct 31, 2025
3703751
chore: unregister isolate *after* disposing isolate
addaleax Oct 31, 2025
8c9aa72
feat!: remove support code for older Node.js versions
addaleax Nov 1, 2025
0193614
chore: add evergreen task for testing dchecks
addaleax Nov 1, 2025
58aa93c
chore: use ubuntu instead of amazon for dcheck runs
addaleax Nov 1, 2025
62befca
fixup: use fixed version of weak-napi
addaleax Nov 3, 2025
c97bb8e
chore: upgrade to vs2022 to test
kmruiz Nov 3, 2025
9a90bfc
chore: upgrade host so it has msvc 2022
kmruiz Nov 3, 2025
0b369dd
chore: typo in the evergreen distro
kmruiz Nov 3, 2025
b18ff4d
chore(ci): use llvm from homebrew on evergreen macOS
addaleax Nov 3, 2025
80a6c5b
chore: Use python3.11 in windows host
kmruiz Nov 4, 2025
5f69428
chore: make sure python 3.11 is used everywhere, also when compiling
kmruiz Nov 4, 2025
6a202b4
chore: make sure that the hash is updated so it uses the proper pytho…
kmruiz Nov 4, 2025
4ce4d23
chore: also setup python and python3 env vars for node-gyp
kmruiz Nov 4, 2025
0d45733
chore: use NODE_GYP_FORCE_PYTHON
kmruiz Nov 4, 2025
729269d
chore: use windows path and simplify
kmruiz Nov 4, 2025
8757467
chore: normalise to spaces
kmruiz Nov 4, 2025
b27af71
chore: untabify, use spaces always
kmruiz Nov 10, 2025
a03f2fa
chore: setup VC environment and upgrade command args for vcbuild
kmruiz Nov 10, 2025
e51e0b3
chore: stub APPDATA env var
kmruiz Nov 10, 2025
c5e2374
chore: adapt it to use CMD properly
kmruiz Nov 10, 2025
6d8d132
chore: fix order of parameters
kmruiz Nov 10, 2025
96e56d2
chore: we still need to projgen
kmruiz Nov 10, 2025
3ce25c4
chore: do not use $TEMP because files there can be deleted
kmruiz Nov 10, 2025
5ae7b1c
chore: typo :(
kmruiz Nov 10, 2025
8190e66
chore: upgrade to node 24 (the LTS) and increase timeout
kmruiz Nov 11, 2025
dc20888
chore: use the same base in all machines (22.17.0)
kmruiz Nov 11, 2025
71190c7
chore: setup windows tests also in GHA for faster feedback
kmruiz Nov 11, 2025
1d3b039
chore: remove unused deps and remove setup of MSVC DevTools
kmruiz Nov 11, 2025
6c2f8ec
chore: support all architecture flags
kmruiz Nov 11, 2025
20b8394
chore: increase timeout (default is 6h, builds can take more time)
kmruiz Nov 11, 2025
5c60c29
chore: fix linter issues
kmruiz Nov 11, 2025
2512e1a
chore: use DEBUG, as it's faster, and it's good enough for a safety c…
kmruiz Nov 12, 2025
484525b
chore: split each test in it's own job to avoid disk space issues
kmruiz Nov 12, 2025
600635a
chore: we can't use cache: npm because we don't have a package-lock
kmruiz Nov 12, 2025
60aacaf
chore: delete precompiled headers on windows and node24>
kmruiz Nov 12, 2025
afb5e0f
chore: Remove test, now the behaviour is tested by the compiler
kmruiz Nov 13, 2025
33cba5b
chore: use rimraf instead of custom code, it should be easier to main…
kmruiz Nov 13, 2025
5e2b32b
chore: Generate the GHA workflow from a template
kmruiz Nov 13, 2025
14075a2
chore: Fix linter issues (spacing and unused deps)
kmruiz Nov 13, 2025
9be677b
chore: use -f instead of -g for the test runner
kmruiz Nov 13, 2025
fda3cca
chore: Remove pch files from compilation artifacts in tmp directory
kmruiz Nov 13, 2025
4f31b14
chore: Print the folder where we are deleting pchs from
kmruiz Nov 13, 2025
a5954aa
chore: attempt to upgrade rimraf to latest version
kmruiz Nov 14, 2025
a199a1c
chore: Use follow: true, so it follows symlinks and junctions
kmruiz Nov 14, 2025
9a03778
chore: resolve the realpath of nodeSourcePath before deleting pchs
kmruiz Nov 14, 2025
5b9d8c2
chore: Remove all directories that can contain compilation outputs
kmruiz Nov 17, 2025
2a6fd18
chore: try to delete the whole out directory for a fresh compilation
kmruiz Nov 17, 2025
a8b3e22
chore: Simplify naming, we now wipe out the whole out directory
kmruiz Nov 17, 2025
b947e75
chore: ensure that any output directory is cleaned up before compiling
kmruiz Nov 17, 2025
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
131 changes: 101 additions & 30 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ functions:
set -e
set -x

export NODE_VERSION=20.13.0
bash .evergreen/install-node.sh
if [ "$OS" == "Windows_NT" ]; then
export NODE_GYP_FORCE_PYTHON="C:\python\Python311\python.exe"
export PATH="/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:$PATH"
fi

export NODE_VERSION=22.17.0
. .evergreen/install-node.sh
install:
- command: shell.exec
params:
Expand All @@ -25,17 +30,29 @@ functions:
set -e
set -x

if [ "$OS" == "Windows_NT" ]; then
export NODE_GYP_FORCE_PYTHON="C:\python\Python311\python.exe"
export PATH="/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:$PATH"
fi

. .evergreen/use-node.sh
npm install
check:
- command: shell.exec
params:
working_dir: src
shell: bash
env:
NODE_VERSION: ${node_version}
script: |
set -e
set -x

if [ "$OS" == "Windows_NT" ]; then
export NODE_GYP_FORCE_PYTHON="C:\python\Python311\python.exe"
export PATH="/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:$PATH"
fi

. .evergreen/use-node.sh
npm run build
npm run lint
Expand All @@ -51,10 +68,29 @@ functions:
AZURE_TEST_CONFIG: ${azure_test_config}
AZURE_TEST_CREDENTIALS: ${azure_test_credentials}
DISTRO_ID: ${distro_id}
BOXEDNODE_DCHECKS_ENABLED: ${dchecks_enabled}
script: |
set -e
set -x

if [ `uname` == "Darwin" ]; then
# the CI macOS machines have an outdated Clang that
# cannot build recent Node.js versions, so we use
# the LLVM version installed via Homebrew
# (both on arm64 and x64)

LLVM_PREFIX="$(brew --prefix llvm)"
export PATH="$LLVM_PREFIX/bin:$PATH"
export CC="$LLVM_PREFIX/bin/clang"
export CXX="$LLVM_PREFIX/bin/clang++"
export LDFLAGS="-L$LLVM_PREFIX/lib -L$LLVM_PREFIX/lib/c++ -L$LLVM_PREFIX/lib/unwind"
export CPPFLAGS="-I$LLVM_PREFIX/include"
export CMAKE_PREFIX_PATH="$LLVM_PREFIX"

$CC --version
$CXX --version
fi

rm -rf /tmp/m && mkdir -pv /tmp/m # Node.js compilation can fail on long path prefixes
trap "rm -rf /tmp/m" EXIT
export TMP=/tmp/m
Expand All @@ -64,49 +100,81 @@ functions:
# able to compile OpenSSL with assembly support,
# so we revert back to the slower version.
if [ "$OS" == "Windows_NT" ]; then
export PATH="/cygdrive/c/python/Python310/Scripts:/cygdrive/c/python/Python310:/cygdrive/c/Python310/Scripts:/cygdrive/c/Python310:$PATH"
export NODE_GYP_FORCE_PYTHON="C:\python\Python311\python.exe"
export PATH="/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:$PATH"
export BOXEDNODE_CONFIGURE_ARGS='openssl-no-asm'
elif uname -a | grep -q 'Darwin.*x86_64'; then
export BOXEDNODE_CONFIGURE_ARGS='--openssl-no-asm'
fi

. .evergreen/use-node.sh
npm run build
TEST_NODE_VERSION="$TEST_NODE_VERSION" npm run test-ci
export TEST_NODE_VERSION="$TEST_NODE_VERSION"
if [ "$OS" == "Windows_NT" ]; then
# The CI machines we have for Windows don't have a working
# installation of VS2022, (vswhere.exe can't find the correct path)
# So we run the scripts to set up the environment manually, and they
# only work properly in CMD
WIN_PATH=$(cygpath -aw .evergreen/test-in-vcdev-env.bat)
cmd.exe /c "$WIN_PATH"
else
npm run build
npm run test-ci
fi

tasks:
- name: test_n14
- name: test_n20
commands:
- func: checkout
- func: install_node
- func: install
- func: test
vars:
node_version: "14.21.3"
- name: test_n16
node_version: "20.19.5"
- name: test_n22
commands:
- func: checkout
- func: install_node
- func: install
- func: test
vars:
node_version: "16.20.1"
- name: test_n18
node_version: "22.21.0"
- name: test_n24
commands:
- func: checkout
- func: install_node
- func: install
- func: test
vars:
node_version: "18.17.0"
- name: test_n20
node_version: "24.10.0"

- name: test_n20_dchecks
commands:
- func: checkout
- func: install_node
- func: install
- func: test
vars:
node_version: "20.19.5"
dchecks_enabled: 1
- name: test_n22_dchecks
commands:
- func: checkout
- func: install_node
- func: install
- func: test
vars:
node_version: "20.13.0"
node_version: "22.21.0"
dchecks_enabled: 1
- name: test_n24_dchecks
commands:
- func: checkout
- func: install_node
- func: install
- func: test
vars:
node_version: "24.10.0"
dchecks_enabled: 1

- name: check
commands:
- func: checkout
Expand All @@ -119,32 +187,35 @@ buildvariants:
display_name: 'Ubuntu 20.04 x64'
run_on: ubuntu2004-large
tasks:
- test_n14
- test_n16
- test_n18
- test_n20
- test_n22
- test_n24
- check
- name: ubuntu_arm64_dchecks
display_name: 'Ubuntu 24.04 arm64 (Node.js/V8 DCHECKs)'
run_on: ubuntu2404-arm64-latest-xlarge
tasks:
- test_n20_dchecks
- test_n22_dchecks
- test_n24_dchecks
- name: macos_x64_test
display_name: 'macOS 11.00 x64'
run_on: macos-1100
display_name: 'macOS 14.00 x64'
run_on: macos-14
tasks:
- test_n14
- test_n16
- test_n18
- test_n20
- test_n22
- test_n24
- name: macos_arm64_test
display_name: 'macOS 11.00 arm64'
run_on: macos-1100-arm64
display_name: 'macOS 14.00 arm64'
run_on: macos-14-arm64
tasks:
- test_n14
- test_n16
- test_n18
- test_n20
- test_n22
- test_n24
- name: windows_x64_test
display_name: 'Windows x64'
run_on: windows-vsCurrent-xlarge
run_on: windows-2022-xlarge
tasks:
- test_n14
- test_n16
- test_n18
- test_n20
- test_n22
- test_n24
21 changes: 15 additions & 6 deletions .evergreen/install-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
set -e
set -x

# so we use the devtools binaries first (for gcc/g++)
export PATH="/opt/devtools/bin:$PATH"

export BASEDIR="$PWD"
mkdir -p .deps
cd .deps

NVM_URL="https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh"
NVM_URL="https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh"

# this needs to be explicitly exported for the nvm install below
export NVM_DIR="$PWD/nvm"
Expand All @@ -21,12 +24,18 @@ if [[ "$OS" == "Windows_NT" ]]; then
mv -v node-v$NODE_VERSION-win-x64/* node/bin
chmod a+x node/bin/*
export PATH="$PWD/node/bin:$PATH"
# install Node.js on Linux/MacOS
else
curl -o- $NVM_URL | bash
set +x
[ -s "${NVM_DIR}/nvm.sh" ] && source "${NVM_DIR}/nvm.sh"
nvm install --no-progress "$NODE_VERSION"
if [ "$(uname -s)" == "Darwin" ] ; then # install Node.js on MacOS
curl -o- $NVM_URL | bash
set +x
[ -s "${NVM_DIR}/nvm.sh" ] && source "${NVM_DIR}/nvm.sh"
nvm install --no-progress "$NODE_VERSION"
else # Linux already has its own toolchain in evergreen
mkdir -p node
NODE_MAJOR=$(echo $NODE_VERSION | awk -F . '{print $1}')
ln -s "/opt/devtools/node$NODE_MAJOR/bin/" "$PWD/node/bin"
export PATH="$PWD/node/bin:$PATH"
fi
fi

which node && node -v || echo "node not found, PATH=$PATH"
Expand Down
6 changes: 6 additions & 0 deletions .evergreen/test-in-vcdev-env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CALL "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"
REM APPDATA is empty in CMD, and npm requires it to be a valid path
SET APPDATA="npm-cache"

CALL npm run build
CALL npm run test-ci
14 changes: 11 additions & 3 deletions .evergreen/use-node.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
if [[ "$OS" == "Windows_NT" ]]; then
export PATH="$PWD/.deps/node/bin:$PATH"
export APPDATA="npm-cache"
export PATH="$PWD/.deps/node/bin:$PATH"
else
export NVM_DIR="$PWD/.deps/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
# so we use the devtools binaries first (for gcc/g++)
export PATH="/opt/devtools/bin:$PATH"

if [ "$(uname -s)" == "Darwin" ] ; then # in OSX use nvm
export NVM_DIR="$PWD/.deps/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
else # In Linux, use .deps/node/bin because it was set up with symlink to an existing node in the toolchain
export PATH="$PWD/.deps/node/bin:$PATH"
fi
fi

echo "updated PATH=$PATH"
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js v18.x
- name: Use Node.js v24.x
if: matrix.language == 'cpp'
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 18.x
node-version: 24.x

- name: Use Node.js v18.x
- name: Use Node.js v24.x
if: matrix.language == 'cpp'
run: |
npm install
Expand Down
54 changes: 47 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a generated file. Please change .github/workflows/nodejs.yml.in
# and run the following command to update the GHA Workflow
# $> npm run update-gha-workflow
# --------------------
on: [pull_request]

name: CI
Expand All @@ -13,19 +17,55 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [20.x, 22.x, 24.x]
test-to-run: ["works in a simple case","works with a Nan addon","works with a N-API addon","passes through env vars and runs the pre-compile hook","works with code caching support","works with snapshot support (compressBlobs = "]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v6
with:
check-latest: true
node-version: ${{ matrix.node-version }}
- name: Install npm@8.x
if: ${{ matrix.node-version == '14.x' }}
run: npm install -g npm@8.x
- name: Install Dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Test
run: npm test
run: npm run test-ci -- -f "${{ matrix.test-to-run }}"

test-windows:
name: Windows tests
strategy:
fail-fast: false
matrix:
os: [windows-latest]
node-version: [20.x, 22.x, 24.x]
vs-version: ['17'] # 17 => VS2022
test-to-run: ["works in a simple case","works with a Nan addon","works with a N-API addon","passes through env vars and runs the pre-compile hook","works with code caching support","works with snapshot support (compressBlobs = "]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
check-latest: true
node-version: ${{ matrix.node-version }}
- uses: microsoft/setup-msbuild@v2
name: Setup MSBuild
with:
vs-version: ${{ matrix.vs-version }}
msbuild-architecture: x64
- name: Install Dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Test
run: npm run test-ci -- -f "${{ matrix.test-to-run }}"
env:
BOXEDNODE_MAKE_ARGS: "debug"

Loading
Loading