Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Nov 18, 2024

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.

@codebytere codebytere added the embedding Issues and PRs related to embedding Node.js in another project. label Nov 18, 2024
@codebytere codebytere added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 18, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 18, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@lpinca lpinca left a 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" ]

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

Comment on lines +187 to +188
libs += [ "hdr_histogram" ]
include_dirs += [ "/usr/include/hdr" ]

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

Comment on lines 153 to 155
"deps/brotli",
"deps/cares",
"deps/histogram",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedding Issues and PRs related to embedding Node.js in another project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants