build: allow linking shared dependencies in the GN build - #65797
Open
codebytere wants to merge 1 commit into
Open
build: allow linking shared dependencies in the GN build#65797codebytere wants to merge 1 commit into
codebytere wants to merge 1 commit into
Conversation
The GN build always compiles the bundled copies of brotli, c-ares, HdrHistogram, llhttp, libuv, nghttp2, SQLite and zstd, so anyone packaging a GN-built Node.js for a Linux distribution has no counterpart to configure's --shared-* options. Add node_shared_* args named after the GYP variables. When one is set, that dependency's GN template defines its target as a group carrying a pkg-config config instead of the bundled sources, so every existing "deps/<name>" reference picks up the system library without further changes, and config.gypi reports the choice like a GYP build does. Refs: nodejs#55903 Signed-off-by: Shelley Vohr <[email protected]>
Collaborator
|
Review requested:
|
Collaborator
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The GN build always compiles the bundled copies of brotli, c-ares, HdrHistogram, llhttp, libuv, nghttp2, SQLite and zstd, so distributions that package a GN-built Node.js have no equivalent of
configure --shared-*and end up carrying their own changes to link the system libraries.This adds
node_shared_brotli,node_shared_cares,node_shared_hdr_histogram,node_shared_http_parser,node_shared_libuv,node_shared_nghttp2,node_shared_sqliteandnode_shared_zstdtonode.gni, named after the GYP variables. When one is set, that dependency's own GN template definesdeps/<name>as a group whose public config comes from pkg-config (libbrotlidec/libbrotlienc,libcares,hdr_histogram,libllhttp,libuv,libnghttp2,sqlite3,libzstd) instead of building the sources, so libnode,node_js2c, uvwasi and everything else that already depends ondeps/<name>links the system copy with no other edits; shared SQLite keepsSQLITE_ENABLE_SESSIONdefined sincesqlite3.hgates the session API on it.generate_config_gypi.pynow reports these inprocess.configinstead of hard-codingfalse. zlib, ICU and OpenSSL are left to the existing//third_party/node_openssl_pathmechanisms, and ada, simdjson and simdutf are left bundled because of the libc++/libstdc++ ABI mismatch raised on the earlier attempt.This replaces #55903, which stalled on review (its pkg-config configs were declared but never applied and some bundled deps were dropped without a replacement) and was closed as stale; doing the switch inside each dep's template is what avoids that here. Most of the diff is re-indentation,
?w=1shows the substance. There is no GN coverage in CI, so this is by inspection against the currentunofficial.gni; defaults are unchanged.Refs: #55903
Disclosure: the code and this description were written by Claude Code, directed and reviewed by @codebytere.