Skip to content

Commit 9480765

Browse files
nicohrubecclaude
andauthored
ref(profiling-node)!: Remove prune-profiler-binaries bin script (#23104)
Removes the `sentry-prune-profiler-binaries` bin script from `@sentry/profiling-node`. The script was already deprecated with a runtime warning and a README notice pointing at #20567. This PR follows through on that removal: * Deletes `scripts/prune-profiler-binaries.js` and its test. * Removes the `bin` mapping and the script's `files` entry from `package.json`. * Drops the pruning walkthrough from the profiling-node README, replacing it with a short note on the binary naming scheme so users who want to prune unused binaries can do so themselves as a build step (as suggested in the issue). * Removes the "register the new ABI in the profiling pruner" step from `docs/supporting-a-new-node-version.md`, since the `NODE_TO_ABI` map no longer needs maintaining. The MIGRATION.md entry for this removal already exists on `develop`, so it is unchanged here. Fixes #20567 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a5afce4 commit 9480765

5 files changed

Lines changed: 6 additions & 281 deletions

File tree

docs/supporting-a-new-node-version.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,10 @@ Reference: [#20710](https://github.com/getsentry/sentry-javascript/pull/20710)
9393
- [ ] `@sentry-internal/node-native-stacktrace` in `packages/node-native/package.json`
9494
- [ ] Run `yarn install` to update `yarn.lock`
9595

96-
3. Register the new ABI in the profiling pruner. In
97-
`packages/profiling-node/scripts/prune-profiler-binaries.js`:
98-
- [ ] Add the Node major to ABI mapping to the `NODE_TO_ABI` object (e.g. `26: '147'`).
99-
- [ ] Add the corresponding `else if (NODE.startsWith('26'))` branch.
100-
101-
4. Allow the new major in the profiling integration, in `packages/profiling-node/src/integration.ts`:
96+
3. Allow the new major in the profiling integration, in `packages/profiling-node/src/integration.ts`:
10297
- [ ] Add the version number to the `if (![16, 18, 20, 22, 24, 26].includes(NODE_MAJOR))` guard
10398
- [ ] Add the version to the supported-versions list in the `console.warn` message below the guard (the string that reads `...prebuilt support for the following LTS versions of Node.js: 16, 18, 20, 22, 24.`)
10499

105-
5. Handle deprecation warnings. Each new Node version tends to deprecate APIs the SDK (or its dependencies) still use, which can break tests that assert on clean stderr or console output.
100+
4. Handle deprecation warnings. Each new Node version tends to deprecate APIs the SDK (or its dependencies) still use, which can break tests that assert on clean stderr or console output.
106101

107-
6. Fix version-specific test failures, some integrations or test dependencies may not yet work on the new version.
102+
5. Fix version-specific test failures, some integrations or test dependencies may not yet work on the new version.

packages/profiling-node/README.md

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -234,46 +234,8 @@ require('esbuild').build({
234234

235235
Once you run `node esbuild.serverless.js` esbuild wil bundle and output the files to ./dist folder, but note that all of
236236
the binaries will be copied. This is wasteful as you will likely only need one of these libraries to be available during
237-
runtime.
238-
239-
> **Deprecation notice:** This script will be removed in the next major version. If you depend on it, please comment on
240-
> [this issue](https://github.com/getsentry/sentry-javascript/issues/20567).
241-
242-
To prune the other libraries, profiling-node ships with a small utility script that helps you prune unused binaries:
243-
244-
```bash
245-
npx --package=@sentry/profiling-node sentry-prune-profiler-binaries
246-
```
247-
248-
Use `--help` to see a list of available options or `--dry-run` if you want it to log the binaries that would have been
249-
deleted.
250-
251-
Example of only preserving a binary to run node16 on linux x64 musl.
252-
253-
```bash
254-
npx --package=@sentry/profiling-node sentry-prune-profiler-binaries --target_dir_path=./dist --target_platform=linux --target_node=16 --target_stdlib=musl --target_arch=x64
255-
```
256-
257-
Which will output something like
258-
259-
```
260-
Sentry: pruned ./dist/sentry_cpu_profiler-darwin-x64-108-IFGH3SUR.node (90.41 KiB)
261-
Sentry: pruned ./dist/sentry_cpu_profiler-darwin-x64-93-Q7KBVHSP.node (74.16 KiB)
262-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-arm64-glibc-108-NXSISRTB.node (52.17 KiB)
263-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-arm64-glibc-83-OEQT5HUK.node (52.08 KiB)
264-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-arm64-glibc-93-IIXXW2PN.node (52.06 KiB)
265-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-arm64-musl-108-DSILNYHA.node (48.46 KiB)
266-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-arm64-musl-83-4CNOBNC3.node (48.37 KiB)
267-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-arm64-musl-93-JA5PKNWQ.node (48.38 KiB)
268-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-x64-glibc-108-NXSISRTB.node (52.17 KiB)
269-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-x64-glibc-83-OEQT5HUK.node (52.08 KiB)
270-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-x64-glibc-93-IIXXW2PN.node (52.06 KiB)
271-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-x64-musl-108-CX7SL27U.node (51.50 KiB)
272-
Sentry: pruned ./dist/sentry_cpu_profiler-linux-x64-musl-83-YD7ZQK2E.node (51.53 KiB)
273-
Sentry: pruned ./dist/sentry_cpu_profiler-win32-x64-108-P7V3URQV.node (181.50 KiB)
274-
Sentry: pruned ./dist/sentry_cpu_profiler-win32-x64-93-3PKQDSGE.node (181.50 KiB)
275-
✅ Sentry: pruned 15 binaries, saved 1.06 MiB in total.
276-
```
237+
runtime. Since the binaries follow the `sentry_cpu_profiler-<platform>-<arch>-<stdlib>-<abi>.node` naming scheme, you can
238+
delete the ones that do not match your target runtime as part of your build step to reduce the deployment size.
277239

278240
### Environment flags
279241

packages/profiling-node/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
}
2323
}
2424
},
25-
"bin": {
26-
"sentry-prune-profiler-binaries": "scripts/prune-profiler-binaries.js"
27-
},
2825
"engines": {
2926
"node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
3027
},
@@ -33,8 +30,7 @@
3330
},
3431
"files": [
3532
"/build",
36-
"package.json",
37-
"/scripts/prune-profiler-binaries.js"
33+
"package.json"
3834
],
3935
"scripts": {
4036
"clean": "rm -rf build",

packages/profiling-node/scripts/prune-profiler-binaries.js

Lines changed: 0 additions & 204 deletions
This file was deleted.

packages/profiling-node/test/prune-profiler-binaries.test.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)