Skip to content

feat: Support Node 24 #12

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

Merged
merged 7 commits into from
May 7, 2025
Merged

feat: Support Node 24 #12

merged 7 commits into from
May 7, 2025

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented May 6, 2025

@AbhiPrasad AbhiPrasad requested review from timfish and a team May 6, 2025 22:57
@AbhiPrasad AbhiPrasad self-assigned this May 6, 2025
@AbhiPrasad AbhiPrasad requested review from mydea and stephanie-anderson and removed request for a team May 6, 2025 22:57
@timfish
Copy link
Collaborator

timfish commented May 6, 2025

The auto cancelled builds look due to #11.

Not sure about the windows failure. I can try building on my windows machine if required!

@AbhiPrasad
Copy link
Member Author

Ah yeah we should do a separate PR for #11 - let me open that up first after asking people about what we should do for libc. I don't think its a usage deal to constrain it (though honestly we should have gotten this done in v9)

@timfish
Copy link
Collaborator

timfish commented May 6, 2025

I think we also need to add an extra Node module abi level to each platform/arch so that pre-built binaries are loaded or bundled:

if (platform === 'darwin') {
if (arch === 'x64') {
if (abi === '108') {
return require('./sentry_cpu_profiler-darwin-x64-108.node');
}
if (abi === '115') {
return require('./sentry_cpu_profiler-darwin-x64-115.node');
}
if (abi === '127') {
return require('./sentry_cpu_profiler-darwin-x64-127.node');
}
}

The abi for v24 is 137:
https://github.com/nodejs/node/blob/9148e965b41dfb322a9e1f38dfaf11ddab0f042c/doc/abi_version_registry.json#L3

@AbhiPrasad
Copy link
Member Author

I think we also need to add an extra Node module abi level to each platform:

I thought these were still in the js repo - good catch! will fix up.

Not sure about the windows failure. I can try building on my windows machine if required!

I thought these were related to C++ 20 but I think I'm wrong. If you could give it a try would be a big help!

@timfish
Copy link
Collaborator

timfish commented May 7, 2025

Node on Windows now builds with ClangCL so we need to also use that to build our native module.

Bumping the node-gyp devDependency to the latest version appears to fix this!

@AbhiPrasad
Copy link
Member Author

Alright brought back the node-gyp upgrade I erased during the rebase

@timfish
Copy link
Collaborator

timfish commented May 7, 2025

I can reproduce the test failure on my local machine. Looks like rmSync(tmpDir, { recursive: true, force: true }) fails with File name too long on macOS. Maybe on macOS we need to do the same via the shell rm -rf?

Maybe this is a Node 24 bug 🤷‍♂️

@AbhiPrasad
Copy link
Member Author

If it works on Node 22 it def is a Node bug.

We should try to reproduce it and open an issue with Node. @timfish could you help with that?

@timfish
Copy link
Collaborator

timfish commented May 7, 2025

When preparing for the tests we clear the yarn cache so that our local packed module gets used. Yarn v1 results in deprecation warnings in Node 24 which were polluting the output when we try and get the cache directory.

@AbhiPrasad AbhiPrasad merged commit 9c804c9 into main May 7, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants