-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: introduce configure --shared #6994
Conversation
@stefanmb it looks like this needs a rebase. Let me know if there is anything I can help with on this |
@nodejs/build we should probably reach out to distro packagers to get feedback on this, if it's not useful to them all then it's probably not worth it as it is. Who do we have? @kapouer is the only one I can think of off the top of my head. |
Yes, why not. I'll try to use that option later today and report back. |
When building a shared library, it is a common and good practice to give it a soname. |
/cc @sgallagher - see #6994 (comment). |
Passing the buck over to @thughes |
We are interested in it because we have internal product teams that what to include Node.js in a product without having a separate process. So I don't see that it should be tied to the distro packages. If they say it would be useful to have a shared library but this does not address the requirement then we need that input and need to adjust. If on the other hand they just don't need a shared library I don't think that invalidates its usefulness as we have examples like electron and our internal team which do want it as a shared library. |
@mhdawson on the debian side i'm pretty sure it's going to be useful, one way or another. |
@kapouer good to hear. |
@thealphanerd Rebased onto master, thanks. @rvagg @mhdawson In addition to Michael's comments, I think the need for this feature was strongly expressed in #5918, nodejs/node-v0.x-archive#7336, and nodejs/roadmap#9. It is my intention to get this feature working on all platforms starting with Linux in this PR. @kapouer Thank you for the soname suggestion, I've implemented it (and fixed the install.py script which I'd previously broken due to some bad merging, sorry!). It required a few hacks to get the information in the right place but the end product will now be "libnode.so.${process.versions.modules}" as you indicated. This may be a bit counter-intuitive to regular users since the module version does not map to the Node release version in an obvious way, but I believe it makes sense to provide this naming convention for embedders. New CI: https://ci.nodejs.org/job/node-test-pull-request/2880/ |
One unrelated failure (socket timeout) on ARM: https://ci.nodejs.org/job/node-test-binary-arm/RUN_SUBSET=0,label=pi1-raspbian-wheezy/2368/console |
@kapouer do you know of any packages that would use this? |
@jbergstroem besides addons (it's more natural to link them to libnode) no, not yet. Electron, eventually... |
@kapouer ok, thanks. How about libv8 bindings? Would any of those deps overflow/consider switching? |
Could you be a little more specific ? I don't understand the question. |
@kapouer sorry; was just wondering if packages that builds against a shared v8 would/could be interested in this. |
@jbergstroem i'm not sure it would be a good idea to link to libnode for a software that just needs v8. Maybe one day libnode will expose only nan-like symbols ? |
16b3dbf
to
69fca3e
Compare
Based on some comments from @mhdawson I've made the following changes:
|
LGTM with one question I'd like to have confirmation for. I assume that post-mortem and vtune support is disabled for node_no_bundled_v8 because we need the specific v8 version/code to support those which we don't have when that option is supported, right ? |
@mhdawson Those options both introduce dependencies from the bundled V8 folder: |
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: nodejs#6994
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: #6994 PR-URL: #9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: nodejs#6994 PR-URL: nodejs#9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: nodejs#6994 PR-URL: nodejs#9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: nodejs#6994 PR-URL: nodejs#9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Required to support the shared library builds on AIX - this sets the shared library suffix within GYP to .a instead of .so on AIX My patch: https://codereview.chromium.org/2492233002/ was landed as as part of this one which fixed some other (not required, but included for completeness of the backport) changes: Ref: https://codereview.chromium.org/2511733005/
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: #6994 PR-URL: #9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This LTS release comes with 108 commits. This includes 30 which are doc related, 28 which are test related, 16 which are build / tool related, and 4 commits which are updates to dependencies. Notable Changes: The SEMVER-MINOR changes include: * build: - export openssl symbols on Windows making it possible to build addons linked against the bundled version of openssl (Alex Hultman) #7576 * debugger: - make listen address configurable in the debugger server (Ben Noordhuis) #3316 * dgram: - generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) #7066 * http: - Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) #4377 * tls: - introduce `secureContext` for `tls.connect` which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) #4246 Notable SEMVER-PATCH changes include: * build: - introduce the configure --shared option for embedders (sxa555) #6994 * gtest: - the test reporter now outputs tap comments as yamlish (Johan Bergström) #9262 * src: - node no longer aborts when c-ares initialization fails (Ben Noordhuis) #8710 * tls: - fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) #9586 PR-URL: #9736
This LTS release comes with 108 commits. This includes 30 which are doc related, 28 which are test related, 16 which are build / tool related, and 4 commits which are updates to dependencies. Notable Changes: The SEMVER-MINOR changes include: * build: - export openssl symbols on Windows making it possible to build addons linked against the bundled version of openssl (Alex Hultman) #7576 * debugger: - make listen address configurable in the debugger server (Ben Noordhuis) #3316 * dgram: - generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) #7066 * http: - Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) #4377 * tls: - introduce `secureContext` for `tls.connect` which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) #4246 Notable SEMVER-PATCH changes include: * build: - introduce the configure --shared option for embedders (sxa555) #6994 * gtest: - the test reporter now outputs tap comments as yamlish (Johan Bergström) #9262 * src: - node no longer aborts when c-ares initialization fails (Ben Noordhuis) #8710 * tls: - fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) #9586 PR-URL: #9736
This LTS release comes with 108 commits. This includes 30 which are doc related, 28 which are test related, 16 which are build / tool related, and 4 commits which are updates to dependencies. Notable Changes: The SEMVER-MINOR changes include: * build: - export openssl symbols on Windows making it possible to build addons linked against the bundled version of openssl (Alex Hultman) #7576 * debugger: - make listen address configurable in the debugger server (Ben Noordhuis) #3316 * dgram: - generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) #7066 * http: - Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) #4377 * tls: - introduce `secureContext` for `tls.connect` which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) #4246 Notable SEMVER-PATCH changes include: * build: - introduce the configure --shared option for embedders (sxa555) #6994 * gtest: - the test reporter now outputs tap comments as yamlish (Johan Bergström) #9262 * src: - node no longer aborts when c-ares initialization fails (Ben Noordhuis) #8710 * tls: - fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) #9586 PR-URL: #9736
This LTS release comes with 108 commits. This includes 30 which are doc related, 28 which are test related, 16 which are build / tool related, and 4 commits which are updates to dependencies. Notable Changes: The SEMVER-MINOR changes include: * build: - export openssl symbols on Windows making it possible to build addons linked against the bundled version of openssl (Alex Hultman) nodejs/node#7576 * debugger: - make listen address configurable in the debugger server (Ben Noordhuis) nodejs/node#3316 * dgram: - generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) nodejs/node#7066 * http: - Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) nodejs/node#4377 * tls: - introduce `secureContext` for `tls.connect` which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) nodejs/node#4246 Notable SEMVER-PATCH changes include: * build: - introduce the configure --shared option for embedders (sxa555) nodejs/node#6994 * gtest: - the test reporter now outputs tap comments as yamlish (Johan Bergstrom) nodejs/node#9262 * src: - node no longer aborts when c-ares initialization fails (Ben Noordhuis) nodejs/node#8710 * tls: - fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) nodejs/node#9586 PR-URL: nodejs/node#9736 Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
This LTS release comes with 108 commits. This includes 30 which are doc related, 28 which are test related, 16 which are build / tool related, and 4 commits which are updates to dependencies. Notable Changes: The SEMVER-MINOR changes include: * build: - export openssl symbols on Windows making it possible to build addons linked against the bundled version of openssl (Alex Hultman) nodejs/node#7576 * debugger: - make listen address configurable in the debugger server (Ben Noordhuis) nodejs/node#3316 * dgram: - generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) nodejs/node#7066 * http: - Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) nodejs/node#4377 * tls: - introduce `secureContext` for `tls.connect` which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) nodejs/node#4246 Notable SEMVER-PATCH changes include: * build: - introduce the configure --shared option for embedders (sxa555) nodejs/node#6994 * gtest: - the test reporter now outputs tap comments as yamlish (Johan Bergstrom) nodejs/node#9262 * src: - node no longer aborts when c-ares initialization fails (Ben Noordhuis) nodejs/node#8710 * tls: - fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) nodejs/node#9586 PR-URL: nodejs/node#9736 Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: #6994 PR-URL: #9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: #6994 PR-URL: #9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
My understanding is also that this would be essential for running on a unrooted andoid. you get one process, which must be java, but you can link a .so which could be |
@dominictarr you should find this commit now in the latest v4, v6, and v7 I believe there are still other edges regarding android... let me know if you try and get it working |
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: #6994 PR-URL: #9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Updates to build the shared library version of node on AIX. Adds the same functionality to AIX that was added on Linux under this: Ref: #6994 PR-URL: #9675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Checklist
Affected core subsystem(s)
build, configure
Description of change
This PR is the continuation of #5918 where the originator (@indutny) agreed that I can take over this task in order to land the changes as soon as possible.
The PR consists of two commits, the original one from #5918 which adds "[a] configure flag for building shared library that could be used to embed Node.js in some application (like Electron)" and a second commit that modifies the following aspects:
I intend to land both commits in the PR at the same time (the original one from @indutny and my changes on top of it) to maintain a clear history/ownership of the work. If anyone feels strongly about this approach either way, please let me know.
All these options are provided as-is for embedders are not officially supported at this time, as indicated in the documentation.
Future changes:
This PR is concerned with Linux only - once this PR is landed a separate PR will be made to resolve issues related to building a DLL on Windows.