Skip to content

build: skip unused OpenSSL arch headers - #66176

Open
anonrig wants to merge 2 commits into
nodejs:mainfrom
anonrig:cursor/openssl-headers-slim-ead2
Open

anonrig wants to merge 2 commits into
nodejs:mainfrom
anonrig:cursor/openssl-headers-slim-ead2

Conversation

@anonrig

@anonrig anonrig commented Sep 21, 2026

Copy link
Copy Markdown
Member

Official Node.js linux-x64 installs currently copy generated OpenSSL headers for every OS/arch into include/node/openssl/archs (~64 MB). Native addons only need the headers that match the installed node binary, plus the dispatcher #else fallback (linux-elf).

A full install now keeps the build arch plus linux-elf. The headers-only tarball (make tar-headers) is unchanged so node-gyp can still target any platform.

Unknown hosts keep the full set (no guessed Linux mapping). OpenBSD maps to BSD-*. Solaris is detected with startswith('sunos') because Python reports sunos5. macOS keeps both darwin64-arm64-cc and darwin64-x86_64-cc because the official .pkg is a universal binary. --shared-openssl builds still do not install bundled arch headers; the new test skips that configuration.

This change was implemented with assistance from a closed-source coding agent. I verified tools/install.py, the arch mapping against deps/openssl/openssl_asm.gypi, and test-install-openssl-headers.js.

Size

Measured against node-v26.9.0-linux-x64:

main this PR delta
Extracted install 229 MB ~171 MB about −25%

The compressed .tar.xz download is almost unchanged because those headers compress extremely well; the win is disk / Docker / nvm extract size.

Tests

test-install-openssl-headers.js.

Official linux-x64 installs copied generated OpenSSL headers for
every OS/arch (~64 MB). A full install now keeps the build arch
plus linux-elf, which dispatcher headers include from #else.

Unknown hosts keep the full set so a guessed Linux mapping cannot
drop headers the dispatcher actually uses. OpenBSD maps to BSD-*
like the dispatcher. Solaris is detected with startswith('sunos')
because Python reports sunos5. macOS keeps both darwin64 arches
because the official .pkg is a universal binary. The headers-only
tarball is unchanged so node-gyp can still target any platform.

On node-v26.9.0-linux-x64 this cuts the extracted install from
229 MB to about 171 MB (about 25%).

Assisted-by: a closed-source coding agent
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. python PRs and issues that require attention from people who are familiar with Python. labels Sep 21, 2026
The JS linter forbids a string literal as the third argument of
assert.deepStrictEqual().

Assisted-by: a closed-source coding agent
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>

Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.28%. Comparing base (dd5dfb5) to head (fde35c5).
⚠️ Report is 38 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66176      +/-   ##
==========================================
+ Coverage   90.27%   90.28%   +0.01%     
==========================================
  Files         790      790              
  Lines      271651   272043     +392     
  Branches    51842    51939      +97     
==========================================
+ Hits       245228   245625     +397     
- Misses      16928    16930       +2     
+ Partials     9495     9488       -7     

see 57 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. python PRs and issues that require attention from people who are familiar with Python.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants