Skip to content

Commit 17e3dc7

Browse files
committed
fix: update pprof prebuild cleanup for @datadog/pprof 5.14.4
The @datadog/pprof package restructured its prebuilds in 5.14.4, breaking the Dockerfile cleanup that removes unused platform/ABI binaries from the Lambda layer: 1. Platform directories renamed: linuxglibc-x64 -> linux-x64, linuxglibc-arm64 -> linux-arm64. The old linuxmusl-* dirs no longer exist as separate dirs; musl .node files now live alongside glibc inside linux-x64/ and linux-arm64/. 2. File naming changed: node-111.node -> dd_pprof.node.abi111.node, so the old glob patterns matched nothing. This caused 36 files (8.6 MB) of unnecessary prebuilds to ship in the layer instead of 8 files (2.1 MB). The fix updates the cleanup to use the new directory/file naming and removes musl binaries via glob, bringing the layer down to 6 files (1.8 MB).
1 parent 74e44c7 commit 17e3dc7

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎Dockerfile‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,21 @@ RUN rm -rf /nodejs/node_modules/aws-xray-sdk-core/node_modules/aws-sdk
5353
# Remove heavy files from @datadog/pprof which aren't used in a lambda environment
5454
# TODO: Ship individual bindings per platform and depend on that instead.
5555
# TODO: Split x64 and ARM so that each image only has the binaries for its architecture.
56+
# Lambda runs on Amazon Linux 2 (glibc), on x64 or arm64.
57+
# Remove non-Linux platform prebuilds
5658
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/darwin-arm64
5759
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/darwin-x64
58-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/linux-arm
59-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/linuxmusl-arm64
60-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/linuxmusl-x64
61-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/win32-ia32
6260
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/win32-x64
63-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-111.node
64-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-120.node
65-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-131.node
66-
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/node-141.node
61+
# Remove musl prebuilds (Lambda uses glibc, not musl)
62+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.musl.node.*.node
63+
# Remove ABIs for non-LTS Node versions not supported on Lambda
64+
# Lambda supports Node 18 (abi108), Node 20 (abi115), Node 22 (abi127)
65+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi111.node
66+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi120.node
67+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi131.node
68+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi137.node
69+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi141.node
70+
RUN rm -rf /nodejs/node_modules/@datadog/pprof/prebuilds/*/dd_pprof.node.abi147.node
6771

6872
# Remove unused @datadog/native-appsec prebuilds for non-Lambda platforms.
6973
# Lambda runs on Amazon Linux 2 (glibc), on x64 or arm64.

0 commit comments

Comments
 (0)