Skip to content

Commit 4292e4a

Browse files
authored
chore(ci): add all relevant Node.js 24 variants to evergreen for CI MONGOSH-2995 (#2586)
* chore: Update boxednode to 3.0.0, so we can support Node.js 24 We are also upgrading the Node.js version we use for the driver nightly tests to 24.11.1 (latest LTS version at the moment of this commit) * chore: Update to latest node-gyp. It should work with Node.js>=20 * chore: Add a Node.js 24 variant to evergreen runs We will be running all tests in both Node.js 20 and Node.js 24 with the current driver version. The nightly driver run that happens every day should do the same with the nightly driver without additional changes. * chore: We should be using the npm version provided by Node.js While older versions of npm had specific issues on Windows, the latest npm@10 and npm@11 seem to be working fine, as they are the ones we are using already in boxednode. * chore: Use --jitless while we have the bugged 24.10 version of Node * chore: In Node.js 22 and Node.js 24 __dirname does not exist For some reason, Node.js 22 and Node.js 24 are more strict on whether __dirname exists. Because import.meta.dirname always exist, and must be equal, replace at the beginning of the script. * chore: Update dependencies and update minimum Node.js version Update to the minimum Node.js version that we have in the devtools-toolchain (20.19.3) * chore: Use process.cwd() instead of __dirname or import.meta While this doesn't have the exact same semantic, it works identical in all Node.js versions and we have control of the cwd of the process, so this should be consistent and work without ESM/CJS trics. * chore: Path was somehow wrong, and it triggered using ESM * chore: Overwriting __dirname just breaks Node 20. * chore: use --no-experimental-strip-types in 24.11.1 * chore: Remove unused config (was not wired yet) * chore: Rollback changes on .evergreen-nightly-driver * chore: Fixes from PR comments * chore: Remove the --jitless flag on v24 Evergreen is already working on providing an up-to-date version of Node.js doesn't contain the JIT compiler issue. We need JIT for WASM support. * chore: Make Node.js 24 variants optional, so they don't block releases Node.js 24 variants are going to be broken for a while, while we work on the upgrade. It doesn't make much sense to keep them running and blocking CI, so we will disable them by default and only run them when a patch asks for it. * chore: Update evergreen config so Node.js 24 is finally optional
1 parent 382a11f commit 4292e4a

File tree

12 files changed

+8274
-1270
lines changed

12 files changed

+8274
-1270
lines changed

.evergreen.yml

Lines changed: 6875 additions & 1104 deletions
Large diffs are not rendered by default.

.evergreen/InstallNode.ps1

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,4 @@ Write-Output "$filename downloaded"
1515
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
1616

1717
Expand-Archive $node_zip -DestinationPath $PSScriptRoot
18-
Get-ChildItem -Path $PSScriptRoot
19-
20-
Set-Location -Path $node_dir
21-
Remove-Item .\npm
22-
Remove-Item .\npm.cmd
23-
if (Test-Path .\npm.ps1) { Remove-Item .\npm.ps1 }
24-
Remove-Item .\npx
25-
Remove-Item .\npx.cmd
26-
if (Test-Path .\npx.ps1) { Remove-Item .\npx.ps1 }
27-
Move-Item .\node_modules\npm -Destination .\node_modules\npm2
28-
.\node.exe .\node_modules\npm2\bin\npm-cli.js i -g npm@6
18+
Get-ChildItem -Path $PSScriptRoot

.evergreen/build-variants/unit-tests-build-variants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ for (const {
1313
shortName: nShort,
1414
versionSpec: nVersion,
1515
skipNodeVersionCheck,
16+
optional,
1617
} of NODE_VERSIONS) {
1718
for (const platform of PLATFORMS) {
1819
const platformDetails = platformToDetails[platform];
@@ -27,6 +28,7 @@ for (const {
2728
nShort,
2829
nVersion,
2930
skipNodeVersionCheck,
31+
disable: optional === true,
3032
});
3133
for (const {
3234
shortName: mShort,
@@ -64,6 +66,7 @@ for (const {
6466
mShort,
6567
mVersion,
6668
skipNodeVersionCheck,
69+
disable: optional === true,
6770
});
6871
}
6972
}

.evergreen/constants.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ exports.platformToDetails = {
2424
const NODE_JS_VERSION_20 = require('./node-20-latest.json').version;
2525
exports.NODE_JS_VERSION_20 = NODE_JS_VERSION_20;
2626

27+
const NODE_JS_VERSION_24 = require('./node-24-latest.json').version;
28+
exports.NODE_JS_VERSION_24 = NODE_JS_VERSION_24;
29+
2730
exports.MONGODB_VERSIONS = [
2831
{ shortName: '42xc', versionSpec: '4.2.x' },
2932
{ shortName: '42xe', versionSpec: '4.2.x-enterprise' },
@@ -47,5 +50,12 @@ exports.NODE_VERSIONS = [
4750
shortName: '20',
4851
versionSpec: NODE_JS_VERSION_20,
4952
skipNodeVersionCheck: '',
53+
optional: false,
54+
},
55+
{
56+
shortName: '24',
57+
versionSpec: NODE_JS_VERSION_24,
58+
skipNodeVersionCheck: '',
59+
optional: true,
5060
},
5161
];

.evergreen/evergreen.yml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,7 @@ buildvariants:
15601560
display_name: "<% out(variant.displayName) %>"
15611561
run_on: <% out(variant.runOn) %>
15621562
tags: <% out(variant.tags) %>
1563+
disable: <% out(variant.disable) %>
15631564
expansions:
15641565
executable_os_id: <% out(variant.executableOsId) %>
15651566
mongosh_server_test_version: "<% out(variant.mVersion || '') %>"

.evergreen/install-node.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ set -e
33
set -x
44
export BASEDIR="$PWD/.evergreen"
55

6-
NPM_VERSION=10.8.3 # 10.9.0 does not install well on Windows
7-
86
if [ "$OS" == "Windows_NT" ]; then
97
powershell "$(cygpath -w "$BASEDIR")"/InstallNode.ps1
108
. "$BASEDIR/setup-env.sh"
11-
mkdir -p "$BASEDIR/npm-10" && (cd "$BASEDIR/npm-10" && echo '{}' > package.json && npm i npm@$NPM_VERSION)
12-
# using npm 10 because npm 9.9.3 does not install well on windows
13-
14-
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
159
else
1610
if [ `uname` = Darwin ]; then
1711
export NVM_DIR="$BASEDIR/.nvm"
1812
mkdir -p "${NVM_DIR}"
19-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
13+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
2014

2115
echo "Setting NVM environment home: $NVM_DIR"
2216
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

.evergreen/node-20-latest.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"end": "2026-04-30T00:00:00.000Z",
1313
"releaseDate": "2025-09-03T00:00:00.000Z",
1414
"isLts": true,
15-
"isSupported": true,
16-
"isMaintenance": true,
17-
"isSecurity": false,
18-
"modules": "115",
1915
"files": [
2016
"aix-ppc64",
2117
"headers",

.evergreen/node-24-latest.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"version": "24.11.1",
3+
"major": 24,
4+
"minor": 11,
5+
"patch": 1,
6+
"tag": "",
7+
"codename": "krypton",
8+
"versionName": "v24",
9+
"start": "2025-05-06T00:00:00.000Z",
10+
"lts": "2025-10-28T00:00:00.000Z",
11+
"maintenance": "2026-10-20T00:00:00.000Z",
12+
"end": "2028-04-30T00:00:00.000Z",
13+
"releaseDate": "2025-11-11T00:00:00.000Z",
14+
"isLts": true,
15+
"files": [
16+
"aix-ppc64",
17+
"headers",
18+
"linux-arm64",
19+
"linux-ppc64le",
20+
"linux-s390x",
21+
"linux-x64",
22+
"osx-arm64-tar",
23+
"osx-x64-pkg",
24+
"osx-x64-tar",
25+
"src",
26+
"win-arm64-7z",
27+
"win-arm64-zip",
28+
"win-x64-7z",
29+
"win-x64-exe",
30+
"win-x64-msi",
31+
"win-x64-zip"
32+
],
33+
"dependencies": {
34+
"npm": "11.6.2",
35+
"v8": "13.6.233.10",
36+
"uv": "1.51.0",
37+
"zlib": "1.3.1",
38+
"openssl": "3.5.4"
39+
}
40+
}

.evergreen/setup-env.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ set -x
44
OS_ARCH="$(uname "-m")"
55

66
export BASEDIR="$PWD/.evergreen"
7-
export PATH="$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk17/bin:$PATH"
8-
7+
export PATH="$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk17/bin:$PATH"
98
export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf"
109

1110
export IS_MONGOSH_EVERGREEN_CI=1
@@ -69,7 +68,7 @@ fi
6968

7069
# On RHEL hosts, we run as root for some reason
7170
if [ `uname` = Linux ]; then
72-
export npm_config_unsafe_perm=true
71+
export npm_config_unsafe_perm=true
7372
fi
7473

7574
# npm@7 changed the behavior to run install scripts for packages

0 commit comments

Comments
 (0)