-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(profiling): Add support for Node v24 in the prune script #18447
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
+27
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/profiling-node/test/prune-profiler-binaries.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { spawnSync } from 'node:child_process'; | ||
| import * as os from 'node:os'; | ||
| import * as path from 'node:path'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| describe('prune-profiler-binaries', () => { | ||
| it('should check if the node version is valid', () => { | ||
| const currentNode = process.version.split('v')[1]; | ||
| const result = spawnSync( | ||
| 'node', | ||
| [ | ||
| path.join(__dirname, '../scripts/prune-profiler-binaries.js'), | ||
| '--target_platform=linux', | ||
| '--target_arch=x64', | ||
| '--target_stdlib=glibc', | ||
| `--target_dir_path=${os.tmpdir()}`, | ||
| `--target_node=${currentNode}`, | ||
| ], | ||
| { encoding: 'utf8' }, | ||
| ); | ||
|
|
||
| expect(result.stdout).not.toContain('Invalid node version passed as argument'); | ||
| }); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The
NODE_TO_ABImapping for Node.js v24 is incorrect, using '134' instead of the stable '137' ABI version.Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The
NODE_TO_ABImapping at line 66 incorrectly hardcodes the ABI version for Node.js v24 as '134'. The actual stable release of Node.js 24.0.0 uses ABI version '137'. This discrepancy causes theprune()function to incorrectly filter binaries, leading to the deletion of correct profiler binaries (those with ABI 137) or failure to retain them. Consequently, the application will lack a compatible profiler binary at runtime, resulting in functional failures when attempting to load the native module.💡 Suggested Fix
Update the
NODE_TO_ABImapping inpackages/profiling-node/scripts/prune-profiler-binaries.jsto set the ABI for Node.js v24 to '137' instead of '134'.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID:
6493649