Repository navigation
include/node/openssl/archs/ has ~50MB of (I hope?) unused headers #46451
Description
Activity
- addedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Jan 31, 2023 Thanks for the suggestion @asottile. I believe this issue will be more relevant in nodejs/node. I don't have the capabilities to transfer it, but I hope other colleagues in the @nodejs/build can do it :)
@UlisesGascon transferred
Reacted by Ulises Gascón@asottile is that the same case for 14.x builds as well? Just wondering if you know if this is new since our OpenSSL 3 integration or its always been that way.
looks like 14.x has the same issue -- but it is much less pronounced there:
$ ls -d node-v14.19.3-linux-x64/include/node/openssl/archs/* node-v14.19.3-linux-x64/include/node/openssl/archs/aix64-gcc node-v14.19.3-linux-x64/include/node/openssl/archs/aix-gcc node-v14.19.3-linux-x64/include/node/openssl/archs/BSD-x86 node-v14.19.3-linux-x64/include/node/openssl/archs/BSD-x86_64 node-v14.19.3-linux-x64/include/node/openssl/archs/darwin64-arm64-cc node-v14.19.3-linux-x64/include/node/openssl/archs/darwin64-x86_64-cc node-v14.19.3-linux-x64/include/node/openssl/archs/darwin-i386-cc node-v14.19.3-linux-x64/include/node/openssl/archs/linux32-s390x node-v14.19.3-linux-x64/include/node/openssl/archs/linux64-mips64 node-v14.19.3-linux-x64/include/node/openssl/archs/linux64-s390x node-v14.19.3-linux-x64/include/node/openssl/archs/linux-aarch64 node-v14.19.3-linux-x64/include/node/openssl/archs/linux-armv4 node-v14.19.3-linux-x64/include/node/openssl/archs/linux-elf node-v14.19.3-linux-x64/include/node/openssl/archs/linux-ppc node-v14.19.3-linux-x64/include/node/openssl/archs/linux-ppc64 node-v14.19.3-linux-x64/include/node/openssl/archs/linux-ppc64le node-v14.19.3-linux-x64/include/node/openssl/archs/linux-x32 node-v14.19.3-linux-x64/include/node/openssl/archs/linux-x86_64 node-v14.19.3-linux-x64/include/node/openssl/archs/solaris64-x86_64-gcc node-v14.19.3-linux-x64/include/node/openssl/archs/solaris-x86-gcc node-v14.19.3-linux-x64/include/node/openssl/archs/VC-WIN32 node-v14.19.3-linux-x64/include/node/openssl/archs/VC-WIN64A node-v14.19.3-linux-x64/include/node/openssl/archs/VC-WIN64-ARM
@asottile thanks for the quick response, the headers are larger in OpenSSL 3 so it might make more sense to prune now than before.
Some history:
- Node.js OpenSSL headers much larger after OpenSSL 3 switch over #42081
- deps: add template for generated headers #42616 attempted some deduplication but it caused a regression deps: regression in openssl #42976 so was reverted Revert "deps: add template for generated headers" #42978.
- addedopensslIssues and PRs related to the OpenSSL dependency.Issues and PRs related to the OpenSSL dependency.
on Jan 31, 2023 @richardlau I think the deduplication attempted before might be a bit different. In the headers tarball I think we need headers for all supported platforms but in the tar for a specific architecture/os it may be ok to just have the one for that architecture/os
In the headers tarball I think we need headers for all supported platforms
I touched on it earlier this week in #46401 but many files in
deps/openssl/config/archs/*/no-asmare duplicates. I count 1018 files but only 183 unique files.My shell-fu says we can shave off 16,068,792 bytes just by deduping those, more if the linked PR lands.
Is there any reason these files can't be deleted completely for a slimmed down runtime only production image?
Is there anything that can be done to help move this work along?
Yes: send pull requests. This is basically waiting for someone to do the work.
I will be honest I am not 100% over what needs to happen. If you can give me a 2 second summary I will go through the code and write up what I think I need to do then do it :)
@andymac4182 the prior work, related issue and revert is a bit higher up in this thread. You probabaly want to stand on top of that should you work towards a new PR! #46451 (comment)
Thanks. I will give it a read over 👍
FWIW, nodejs/docker-node#1923 has landed
We might need to do it for slim and alpine as well
Reacted by Johan Bergström and Stevengithub-actions commented
on Jun 22, 2026 on Jun 22, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jun 22, 2026 github-actions commented
on Jul 23, 2026 on Jul 23, 2026 – with GitHub ActionsContributorMore actionsThis issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.Reacted by anthony sottile
it looks like the prebuilt builds contain openssl headers for each architecture, even though they are only built for one -- potentially saving ~50MB ish: