Skip to content

Commit ee6ebd2

Browse files
AbhiPrasadJonasBa
authored andcommitted
feat(node): [v7] Support Node 22 (#11754)
tracking issue: #11455 ABI is 126: https://github.com/electron/node-abi/blob/bd11f2da07c5da324e735e2de5bf6716ce97b11c/abi_registry.json#L95-L102 ~Waiting for nodejs/node#52505 to release!~ Added changelog entry for `7.113.0`, will cut a release after this gets merged. --------- Co-authored-by: JonasBa <jonas@badalic.com>
1 parent 08a3b7c commit ee6ebd2

File tree

7 files changed

+71
-18
lines changed

7 files changed

+71
-18
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ jobs:
509509
strategy:
510510
fail-fast: false
511511
matrix:
512-
node: [14, 16, 18, 20, 21]
512+
node: [14, 16, 18, 20, 22]
513513
steps:
514514
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
515515
uses: actions/checkout@v4
@@ -569,7 +569,7 @@ jobs:
569569
strategy:
570570
fail-fast: false
571571
matrix:
572-
node: [14, 16, 18, 20, 21]
572+
node: [14, 16, 18, 20, 22]
573573
steps:
574574
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
575575
uses: actions/checkout@v4
@@ -832,12 +832,12 @@ jobs:
832832
strategy:
833833
fail-fast: false
834834
matrix:
835-
node: [14, 16, 18, 20, 21]
835+
node: [14, 16, 18, 20, 22]
836836
typescript:
837837
- false
838838
include:
839839
# Only check typescript for latest version (to streamline CI)
840-
- node: 20
840+
- node: 22
841841
typescript: '3.8'
842842
steps:
843843
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -874,7 +874,7 @@ jobs:
874874
strategy:
875875
fail-fast: false
876876
matrix:
877-
node: [18, 20, 21]
877+
node: [18, 20, 22]
878878
remix: [1, 2]
879879
# Remix v2 only supports Node 18+, so run Node 14, 16 tests separately
880880
include:
@@ -1294,6 +1294,8 @@ jobs:
12941294
node: 18
12951295
- os: ubuntu-20.04
12961296
node: 20
1297+
- os: ubuntu-20.04
1298+
node: 22
12971299

12981300
# x64 musl
12991301
- os: ubuntu-20.04
@@ -1305,6 +1307,9 @@ jobs:
13051307
- os: ubuntu-20.04
13061308
container: node:20-alpine3.17
13071309
node: 20
1310+
- os: ubuntu-20.04
1311+
container: node:22-alpine3.18
1312+
node: 22
13081313

13091314
# arm64 glibc
13101315
- os: ubuntu-20.04
@@ -1316,6 +1321,9 @@ jobs:
13161321
- os: ubuntu-20.04
13171322
arch: arm64
13181323
node: 20
1324+
- os: ubuntu-20.04
1325+
arch: arm64
1326+
node: 22
13191327

13201328
# arm64 musl
13211329
- os: ubuntu-20.04
@@ -1330,6 +1338,10 @@ jobs:
13301338
arch: arm64
13311339
container: node:20-alpine3.17
13321340
node: 20
1341+
- os: ubuntu-20.04
1342+
arch: arm64
1343+
container: node:22-alpine3.18
1344+
node: 22
13331345

13341346
# macos x64
13351347
- os: macos-11
@@ -1341,35 +1353,42 @@ jobs:
13411353
- os: macos-11
13421354
node: 20
13431355
arch: x64
1356+
- os: macos-11
1357+
node: 22
1358+
arch: x64
13441359

13451360
# macos arm64
13461361
- os: macos-12
13471362
arch: arm64
13481363
node: 16
13491364
target_platform: darwin
1350-
13511365
- os: macos-12
13521366
arch: arm64
13531367
node: 18
13541368
target_platform: darwin
1355-
13561369
- os: macos-12
13571370
arch: arm64
13581371
node: 20
13591372
target_platform: darwin
1373+
- os: macos-12
1374+
arch: arm64
1375+
node: 22
1376+
target_platform: darwin
13601377

13611378
# windows x64
13621379
- os: windows-2022
13631380
node: 16
13641381
arch: x64
1365-
13661382
- os: windows-2022
13671383
node: 18
13681384
arch: x64
1369-
13701385
- os: windows-2022
13711386
node: 20
13721387
arch: x64
1388+
- os: windows-2022
1389+
node: 22
1390+
arch: x64
1391+
13731392
steps:
13741393
- name: Setup (alpine)
13751394
if: contains(matrix.container, 'alpine')

packages/profiling-node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ npm i -g windows-build-tools
6666

6767
### Prebuilt binaries
6868

69-
We currently ship prebuilt binaries for a few of the most common platforms and node versions (v16-20).
69+
We currently ship prebuilt binaries for a few of the most common platforms and node versions (v16-22).
7070

7171
- macOS x64
7272
- Linux ARM64 (musl)

packages/profiling-node/binding.gyp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,15 @@
66
# Silence gcc8 deprecation warning https://github.com/nodejs/nan/issues/807#issuecomment-455750192
77
"cflags": ["-Wno-cast-function-type"]
88
},
9-
]
9+
],
10+
'conditions': [
11+
[ 'OS=="win"', {
12+
'defines': [
13+
# Stop <windows.h> from defining macros that conflict with
14+
# std::min() and std::max(). We don't use <windows.h> (much)
15+
# but we still inherit it from uv.h.
16+
'NOMINMAX',
17+
]
18+
}],
19+
],
1020
}

packages/profiling-node/bindings/cpu_profiler.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef NOMINMAX
2+
#define NOMINMAX
3+
#endif
14

25
#include <assert.h>
36
#include <math.h>

packages/profiling-node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@
8282
"@sentry/types": "8.0.0-beta.5",
8383
"@sentry/utils": "8.0.0-beta.5",
8484
"detect-libc": "^2.0.2",
85-
"node-abi": "^3.52.0"
85+
"node-abi": "^3.61.0"
8686
},
8787
"devDependencies": {
8888
"@types/node": "16.18.70",
89-
"@types/node-abi": "^3.0.0",
89+
"@types/node-abi": "^3.0.3",
9090
"clang-format": "^1.8.0",
9191
"cross-env": "^7.0.3",
9292
"node-gyp": "^9.4.1",

packages/profiling-node/src/cpu_profiler.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
4747
if (abi === '115') {
4848
return require('../sentry_cpu_profiler-darwin-x64-115.node');
4949
}
50+
if (abi === '127') {
51+
return require('./sentry_cpu_profiler-darwin-x64-127.node');
52+
}
5053
}
5154

5255
if (arch === 'arm64') {
@@ -59,6 +62,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
5962
if (abi === '115') {
6063
return require('../sentry_cpu_profiler-darwin-arm64-115.node');
6164
}
65+
if (abi === '127') {
66+
return require('./sentry_cpu_profiler-darwin-arm64-127.node');
67+
}
6268
}
6369
}
6470

@@ -73,6 +79,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
7379
if (abi === '115') {
7480
return require('../sentry_cpu_profiler-win32-x64-115.node');
7581
}
82+
if (abi === '127') {
83+
return require('./sentry_cpu_profiler-win32-x64-127.node');
84+
}
7685
}
7786
}
7887

@@ -88,6 +97,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
8897
if (abi === '115') {
8998
return require('../sentry_cpu_profiler-linux-x64-musl-115.node');
9099
}
100+
if (abi === '127') {
101+
return require('./sentry_cpu_profiler-linux-x64-musl-127.node');
102+
}
91103
}
92104
if (stdlib === 'glibc') {
93105
if (abi === '93') {
@@ -99,6 +111,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
99111
if (abi === '115') {
100112
return require('../sentry_cpu_profiler-linux-x64-glibc-115.node');
101113
}
114+
if (abi === '127') {
115+
return require('./sentry_cpu_profiler-linux-x64-glibc-127.node');
116+
}
102117
}
103118
}
104119
if (arch === 'arm64') {
@@ -112,6 +127,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
112127
if (abi === '115') {
113128
return require('../sentry_cpu_profiler-linux-arm64-musl-115.node');
114129
}
130+
if (abi === '127') {
131+
return require('./sentry_cpu_profiler-linux-arm64-musl-127.node');
132+
}
115133
}
116134
if (stdlib === 'glibc') {
117135
if (abi === '93') {
@@ -123,6 +141,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
123141
if (abi === '115') {
124142
return require('../sentry_cpu_profiler-linux-arm64-glibc-115.node');
125143
}
144+
if (abi === '127') {
145+
return require('./sentry_cpu_profiler-linux-arm64-glibc-127.node');
146+
}
126147
}
127148
}
128149
}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8620,7 +8620,7 @@
86208620
dependencies:
86218621
"@types/unist" "^2"
86228622

8623-
"@types/node-abi@^3.0.0":
8623+
"@types/node-abi@^3.0.3":
86248624
version "3.0.3"
86258625
resolved "https://registry.yarnpkg.com/@types/node-abi/-/node-abi-3.0.3.tgz#a8334d75fe45ccd4cdb2a6c1ae82540a7a76828c"
86268626
integrity sha512-5oos6sivyXcDEuVC5oX3+wLwfgrGZu4NIOn826PGAjPCHsqp2zSPTGU7H1Tv+GZBOiDUY3nBXY1MdaofSEt4fw==
@@ -22960,10 +22960,10 @@ node-abi@^3.3.0:
2296022960
dependencies:
2296122961
semver "^7.3.5"
2296222962

22963-
node-abi@^3.52.0:
22964-
version "3.54.0"
22965-
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.54.0.tgz#f6386f7548817acac6434c6cba02999c9aebcc69"
22966-
integrity sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==
22963+
node-abi@^3.61.0:
22964+
version "3.61.0"
22965+
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.61.0.tgz#9248f8b8e35dbae2fafeecd6240c5a017ea23f3f"
22966+
integrity sha512-dYDO1rxzvMXjEMi37PBeFuYgwh3QZpsw/jt+qOmnRSwiV4z4c+OLoRlTa3V8ID4TrkSQpzCVc9OI2sstFaINfQ==
2296722967
dependencies:
2296822968
semver "^7.3.5"
2296922969

0 commit comments

Comments
 (0)