-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
http2: Allow using a shared nghttp2 library #14920
Conversation
Just fyi, the version bundled with Node uses the yet-unreleased patch in nghttp2/nghttp2@eb306f4 for performance optimizations, so I think you’ll need to wait for another release for a shared lib to be actually usable. |
Thanks. I guess it would be nice if it turned out the node release that uses |
@jer-gentoo @nodejs/http2 Do you know whether nghttp2 has a specific release cycle? We might just be able to ask for a release upstream |
PR for upgrading nghttp2 to v1.25.0: #14955 |
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.
LGTM, can confirm that this compiles & runs.
The only puzzling aspect of the way the node target is built is that the shared dependencies are not listed for that target, but for the |
@jer-gentoo @nodejs/platform-windows This doesn’t seem to be working on Windows yet: https://ci.nodejs.org/job/node-compile-windows/11266/label=win-vs2017/console |
@addaleax : Yes, it does look like the linker can't find a shared nghttp2 library, and hasn't been asked to:
But why does it then succeed in finding those other libraries and not nghttp2? |
'node_js2c#host' | ||
], | ||
|
||
'conditions': [ |
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.
AFAICT this needs to move to node.gypi
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.
Isn't *.gypi
generated by the configure
script?
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.
Only config.gypi
is runtime generated, node.gypi
is human generated. AFAICT this is the relevant section
Lines 246 to 260 in ffed7b6
[ 'node_shared_zlib=="false"', { | |
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ], | |
}], | |
[ 'node_shared_http_parser=="false"', { | |
'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ], | |
}], | |
[ 'node_shared_cares=="false"', { | |
'dependencies': [ 'deps/cares/cares.gyp:cares' ], | |
}], | |
[ 'node_shared_libuv=="false"', { | |
'dependencies': [ 'deps/uv/uv.gyp:libuv' ], | |
}], |
@@ -277,9 +284,7 @@ | |||
'NODE_PLATFORM="<(OS)"', | |||
'NODE_WANT_INTERNALS=1', | |||
# Warn when using deprecated V8 APIs. | |||
'V8_DEPRECATION_WARNINGS=1', | |||
# We're using the nghttp2 static lib | |||
'NGHTTP2_STATICLIB' |
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.
You might need the condition for this target as well.
@jer-gentoo I tried to look at the file, but it's not easy reasoning "analytically" about If you have access to Windows compare the |
I don't have access to Windows. |
I will try to test this on windows later this week. |
Ping @jasnell |
I opened #15256 which has a single clean commit. |
As nice as it is to bundle several libraries for builders' convenience, it also exposes builders to several kinds of security problems (until you release a new version with the bundled libraries updated) and it duplicates the number of versions of a library present on systems. For instance, with libcurl/curl installed and built against nghttp2, having a bundled (and older) version of libnghttp2 statically linked into /usr/bin/node duplicates the other version already present in /usr/lib. Additionally, the currently bundled version 1.22.0 has several problems that were already fixed in later versions, notably the current 1.24.0 which has been out since early July 2017.