-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Backport --shared to V4.x codebase to allow building as a shared library / DLL #9385
Conversation
@nodejs/lts @jbergstroem |
Nit: there's a typo in the commit log message in 4bb43f7 |
@sxa555 were there other pr's for the windows support and abstraction? I don't see those in #7687 Also would it be possible for you to include the full original commit title and message from the original commit that landed, including all applicable meta data see a722205 for an example You can include the url to this PR as a |
Added PR Refs to description. The original PRs included multiple number of individual commits which I haven't duplicated individually for V4 - I've just got one commit for each of the three related PRs commit descriptions for the Windows and Linux ones updated to align the messages from those PRs. Some of the things from my "abstract out" commit were done in commits within the original #6994 but for simplicity of merging what I already had for V4 I've put it all in the third of the commits. Hope that's ok |
0adff46
to
9cd4f68
Compare
@sxa555 the meta data on the commits are still not the same as the original. Please use the entire original commit message. For example 8df50ac should be changed from
to
I'm a bit concerned with the commit 7bfa0f2 which does not appear to have gone through review yet. Is this simply extra stuff that needs to be modified to make the backport work or is this completely new stuff that needs to be reviewed again? |
@@ -351,7 +354,8 @@ goto exit | |||
|
|||
:help | |||
|
|||
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] | |||
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] [dll] | |||
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] |
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.
Duplicate line.
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.
Fixed
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 with a style nit.
static void fn(void) __attribute__((constructor)); \ | ||
static void fn(void) | ||
NODE_CTOR_PREFIX void fn(void) __attribute__((constructor)); \ | ||
NODE_CTOR_PREFIX void fn(void) |
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.
Can you make sure the backslashes line up?
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.
Done
@@ -995,7 +995,7 @@ | |||
'VCCLCompilerTool': { | |||
'Optimization': '0', | |||
'conditions': [ | |||
['component=="shared_library"', { | |||
['component=="shared_library" or node_shared=="true"', { |
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.
In v6.x this looks like:
['component=="shared_library" or force_dynamic_crt==1', {
Further, in master I think it still uses force_dynamic_crt
I would have expected the backport for 4.x to be consistent ?
So this should be consistent with what we landed in v8 right ?
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.
Looks to me like there are some changes in this PR which are not in the original PRs, unless I'm looking incorrectly as noted in line comments. I think a backport should just be the original changes with the only additional changes being those needed to make them apply/work.
If thats the case and I'm misunderstanding just let me know.
output_prefix += 'lib.target/' | ||
output_file = 'lib' + output_file + '.so' | ||
|
||
action([output_prefix + output_file], 'bin/' + output_file) |
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.
In v6.x it looks like this:
parser.add_option('--static-libstdc++', | ||
action='store_true', | ||
dest='use_static_libstdcpp', | ||
help='statically link to libstdc++ library instead of dynamically linking') |
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.
Looks like this was removed in v6.x so thinking we don't want to add in v4.x. I also don't see it in #6994 so I'm wondering where it came from.
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.
Not sure, although there is another reference to -static-libstdc++ in the configure script. I've removed it.
@@ -351,7 +354,7 @@ goto exit | |||
|
|||
:help | |||
|
|||
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] | |||
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] [dll] | |||
|
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.
The line for v6.x is
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosign] [x86/x64] [vc2015] [download-all] [enable-vtune]
which does not have the [dll], and its not there in master either ? Its also not in #7487
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.
Fair point - it probably should have been though. I'll look at getting that added in via master. I've removed it for consistency here though
Updated with the V8 change (including version bump) as a separate commit as requested |
hey @sxa555 sorry for making this so difficult. I ended up fixing the backport on v6.x and have landed a proper backport, with appropriate meta data, in 5bb29683a5fe7600026fc8ea3747d707376dd31e As such you can you please remove 00052e5 from this PR and rebase against the staging branch. After doing that I'll want to run the test suite one more time and then this will be ready to land! edit: IGNORE ALL OF THIS |
It looks like the other patch didn't work. I bet that is the reason for the original diff... something likely landed in the gyp file of v6.x that fixed it between when it originally landed and now. This patch lands and works, so let's just stick to it. If this CI is green I will land this PR: https://ci.nodejs.org/job/node-test-pull-request/4876/ |
test/freebsd 11 looks to be failing for other integration tests so I don't think that's related. Have pushed a fix to the linter failure by adding another space. |
@sxa555 sorry that this process keeps dragging out. it would appear you made this PR target When targeting the correct branch there is a conflict in node.gyp --- a/node.gyp
+++ b/node.gyp
@@@ -94,12 -99,10 +99,19 @@@
'deps/v8/tools/tickprocessor-driver.js',
],
'conditions': [
++<<<<<<< HEAD
+ [ 'OS=="win" and '
+ 'node_use_openssl=="true" and '
+ 'node_shared_openssl=="false"', {
+ 'use_openssl_def': 1,
+ }, {
+ 'use_openssl_def': 0,
++=======
+ [ 'node_shared=="true"', {
+ 'node_target_type%': 'shared_library',
+ }, {
+ 'node_target_type%': 'executable',
++>>>>>>> build: configure --shared
}],
],
}, Once the conflict is resolved, we can run the CI one last time. Thank you for your patience |
PR-URL: nodejs#8084 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Add configure flag for building a shared library that can be embedded in other applications (like Electron). Add flags --without-bundled-v8 and --without-v8-platform to control V8 dependencies used. PR-URL: nodejs#6994 Ref: nodejs#9385 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reference: nodejs#7487
WIP: Add soname & fix make install PR-URL: nodejs#6994 Ref: nodejs#9385 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor@indutny.com> The build system currently creates a shared library on OS X with the same name as on Linux i.e. libnode.so.48. This is inconsistent with the conventions on OS X which uses libnode.48.dylib This commit changes the build process and install.py (used by make binary) to build with the correct name on OS X when the --shared configure parameter is used. PR-URL: nodejs#7687 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Now resolved :-) |
One more CI run |
Add configure flag for building a shared library that can be embedded in other applications (like Electron). Add flags --without-bundled-v8 and --without-v8-platform to control V8 dependencies used. PR-URL: #6994 Ref: #7487 Ref: #9385 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Original Commit Message: Added "dll" option to vcbuild.bat Insure that Unix SO name is not used on Windows (i.e. produce a .dll file) Insure that Node and its V8 dependency link against the Visual C++ Runtime dynamically. Requires backported V8 patch, see PR 7802. Ref: #7802 PR-URL: #7487 Reviewed-By: Alexis Campailla <alexis@janeasystems.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> PR-URL: #9385 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
landed in 527db40...e97723b |
Ref: nodejs/node#9385 PR-URL: nodejs/node#8084 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
build
Description of change
Enable the --shared parameter for building node as a shared library on Linux/OS X/Windows. This is a backport of the support that's already in the V6 codebase. Reference #7687 - FYI @thealphanerd