-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: allow unbundling of Node.js dependencies #55903
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
@@ -179,7 +178,17 @@ template("node_gn_build") { | |||
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |||
configs += [ "//build/config/gcc:symbol_visibility_default" ] | |||
} | |||
|
|||
if (use_system_llhttp) { | |||
libs += [ "llhttp" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This passes -lllhttp
to the linker, but does not add its header location to include_dirs - pkg-config can resolve it under the name libllhttp
libs += [ "hdr_histogram" ] | ||
include_dirs += [ "/usr/include/hdr" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also should be pkg_config on hdr_histogram
"deps/brotli", | ||
"deps/cares", | ||
"deps/histogram", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"deps/brotli", | |
"deps/cares", | |
"deps/histogram", |
histogram gets added below if !use_system_histogram
, for brotli and cares the newly created targets should be added instead if unbundling (currently they don't get used for anything)
Refs electron/electron#44691
Linux distributions have guidelines on using distro-provided dependencies, rather than compiling them in statically - Electron already did this via electron/electron#34841 until we ingested Node.js' GN support, which didn't contain this.
This PR this enables downstream packagers to unbundle these dependencies. We don't need to do this for zlib, as the existing gn workflow uses the same
//third_party/zlib
, so unbundling zlib with Chromium tools in//build/linux/unbundle
works already. This adds support for some of the others.