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

feat(node): [v7] Support Node 22 #11754

Merged
merged 7 commits into from May 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 28 additions & 9 deletions .github/workflows/build.yml
Expand Up @@ -533,7 +533,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [8, 10, 12, 14, 16, 18, 20, 21]
node: [8, 10, 12, 14, 16, 18, 20, 22]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -595,7 +595,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16, 18, 20, 21]
node: [10, 12, 14, 16, 18, 20, 22]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -884,12 +884,12 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16, 18, 20, 21]
node: [10, 12, 14, 16, 18, 20, 22]
typescript:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 20
- node: 22
typescript: '3.8'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
Expand Down Expand Up @@ -925,7 +925,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20, 21]
node: [18, 20, 22]
remix: [1, 2]
# Remix v2 only supports Node 18+, so run Node 14, 16 tests separately
include:
Expand Down Expand Up @@ -1338,6 +1338,8 @@ jobs:
node: 18
- os: ubuntu-20.04
node: 20
- os: ubuntu-20.04
node: 22

# x64 musl
- os: ubuntu-20.04
Expand All @@ -1349,6 +1351,9 @@ jobs:
- os: ubuntu-20.04
container: node:20-alpine3.17
node: 20
- os: ubuntu-20.04
container: node:22-alpine3.18
node: 22

# arm64 glibc
- os: ubuntu-20.04
Expand All @@ -1360,6 +1365,9 @@ jobs:
- os: ubuntu-20.04
arch: arm64
node: 20
- os: ubuntu-20.04
arch: arm64
node: 22

# arm64 musl
- os: ubuntu-20.04
Expand All @@ -1374,6 +1382,10 @@ jobs:
arch: arm64
container: node:20-alpine3.17
node: 20
- os: ubuntu-20.04
arch: arm64
container: node:22-alpine3.18
node: 22

# macos x64
- os: macos-11
Expand All @@ -1385,35 +1397,42 @@ jobs:
- os: macos-11
node: 20
arch: x64
- os: macos-11
node: 22
arch: x64

# macos arm64
- os: macos-12
arch: arm64
node: 16
target_platform: darwin

- os: macos-12
arch: arm64
node: 18
target_platform: darwin

- os: macos-12
arch: arm64
node: 20
target_platform: darwin
- os: macos-12
arch: arm64
node: 22
target_platform: darwin

# windows x64
- os: windows-2022
node: 16
arch: x64

- os: windows-2022
node: 18
arch: x64

- os: windows-2022
node: 20
arch: x64
- os: windows-2022
node: 22
arch: x64

steps:
- name: Setup (alpine)
if: contains(matrix.container, 'alpine')
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,14 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.113.0

- **feat(node): Support Node 22 (#11754)**

This release adds support for Node 22! 🎉

It also adds prebuilt-binaries for Node 22 to `@sentry/profiling-node`.

## 7.112.2

- fix(nextjs|sveltekit): Ensure we can pass `browserTracingIntegration` (#11765)
Expand Down
2 changes: 1 addition & 1 deletion packages/profiling-node/README.md
Expand Up @@ -68,7 +68,7 @@ npm i -g windows-build-tools

### Prebuilt binaries

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

- macOS x64
- Linux ARM64 (musl)
Expand Down
12 changes: 11 additions & 1 deletion packages/profiling-node/binding.gyp
Expand Up @@ -6,5 +6,15 @@
# Silence gcc8 deprecation warning https://github.com/nodejs/nan/issues/807#issuecomment-455750192
"cflags": ["-Wno-cast-function-type"]
},
]
],
'conditions': [
[ 'OS=="win"', {
'defines': [
# Stop <windows.h> from defining macros that conflict with
# std::min() and std::max(). We don't use <windows.h> (much)
# but we still inherit it from uv.h.
'NOMINMAX',
]
}],
],
}
3 changes: 3 additions & 0 deletions packages/profiling-node/bindings/cpu_profiler.cc
@@ -1,3 +1,6 @@
#ifndef NOMINMAX
#define NOMINMAX
#endif

#include <assert.h>
#include <math.h>
Expand Down
4 changes: 2 additions & 2 deletions packages/profiling-node/package.json
Expand Up @@ -65,15 +65,15 @@
},
"dependencies": {
"detect-libc": "^2.0.2",
"node-abi": "^3.52.0"
"node-abi": "^3.61.0"
},
"devDependencies": {
"@sentry/core": "7.112.2",
"@sentry/node": "7.112.2",
"@sentry/types": "7.112.2",
"@sentry/utils": "7.112.2",
"@types/node": "16.18.70",
"@types/node-abi": "^3.0.0",
"@types/node-abi": "^3.0.3",
"clang-format": "^1.8.0",
"cross-env": "^7.0.3",
"node-gyp": "^9.4.1",
Expand Down
21 changes: 21 additions & 0 deletions packages/profiling-node/src/cpu_profiler.ts
Expand Up @@ -48,6 +48,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-darwin-x64-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-darwin-x64-127.node');
}
}

if (arch === 'arm64') {
Expand All @@ -60,6 +63,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-darwin-arm64-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-darwin-arm64-127.node');
}
}
}

Expand All @@ -74,6 +80,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-win32-x64-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-win32-x64-127.node');
}
}
}

Expand All @@ -89,6 +98,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-linux-x64-musl-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-linux-x64-musl-127.node');
}
}
if (stdlib === 'glibc') {
if (abi === '93') {
Expand All @@ -100,6 +112,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-linux-x64-glibc-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-linux-x64-glibc-127.node');
}
}
}
if (arch === 'arm64') {
Expand All @@ -113,6 +128,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-linux-arm64-musl-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-linux-arm64-musl-127.node');
}
}
if (stdlib === 'glibc') {
if (abi === '93') {
Expand All @@ -124,6 +142,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
if (abi === '115') {
return require('./sentry_cpu_profiler-linux-arm64-glibc-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-linux-arm64-glibc-127.node');
}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -6769,7 +6769,7 @@
dependencies:
"@types/unist" "^2"

"@types/node-abi@^3.0.0":
"@types/node-abi@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/node-abi/-/node-abi-3.0.3.tgz#a8334d75fe45ccd4cdb2a6c1ae82540a7a76828c"
integrity sha512-5oos6sivyXcDEuVC5oX3+wLwfgrGZu4NIOn826PGAjPCHsqp2zSPTGU7H1Tv+GZBOiDUY3nBXY1MdaofSEt4fw==
Expand Down Expand Up @@ -23205,10 +23205,10 @@ node-abi@^3.3.0:
dependencies:
semver "^7.3.5"

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

Expand Down