GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Backport --shared to V4.x codebase to allow building as a shared library / DLL by sxa · Pull Request #9385 · nodejs/node

Conversation

@sxa

@sxa sxa commented Oct 31, 2016

Copy link
Copy Markdown
Member
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. c++ Issues and PRs that require attention from people who are familiar with C++. tools Issues and PRs related to the tools directory. v4.x labels Oct 31, 2016
@sxa sxa changed the title V4.x sharedlib Enable --shared in V4.x codebase to allow building as a shared library / DLL Oct 31, 2016
@sxa sxa changed the title Enable --shared in V4.x codebase to allow building as a shared library / DLL Backport --shared to V4.x codebase to allow building as a shared library / DLL Oct 31, 2016
@jasnell

jasnell commented Nov 2, 2016

Copy link
Copy Markdown
Member

@nodejs/lts @jbergstroem

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 2, 2016

Copy link
Copy Markdown
Member

Nit: there's a typo in the commit log message in 4bb43f7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Nov 2, 2016

Copy link
Copy Markdown
Contributor

@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 Ref:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sxa
sxa force-pushed the v4.x-sharedlib branch from ab55c53 to fb2b7ef Compare November 2, 2016 16:53
@sxa

sxa commented Nov 2, 2016

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sxa
sxa force-pushed the v4.x-sharedlib branch 2 times, most recently from 0adff46 to 9cd4f68 Compare November 7, 2016 19:01
@MylesBorins

MylesBorins commented Nov 7, 2016

Copy link
Copy Markdown
Contributor

@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

 build: introduce configure --shared

Backport support for building as a shared library on Linux to V4
Ref: https://github.com/nodejs/node/pull/6994

to

 build: configure --shared

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: https://github.com/nodejs/node/pull/6994
Ref: https://github.com/nodejs/node/pull/9385
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sxa

sxa commented Nov 7, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

ref 7bfa0f2 it is a combination of the additions in 410296c to pick up the version info and the modifications that were requested in af2d04b. I'll add the commit messages tomorrow - cheers for the info

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sxa
sxa force-pushed the v4.x-sharedlib branch from 9cd4f68 to 7bfa0f2 Compare November 8, 2016 11:00
bnoordhuis
bnoordhuis requested changes Nov 8, 2016
View reviewed changes
Comment thread vcbuild.bat Outdated

@bnoordhuis bnoordhuis Nov 8, 2016

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sxa sxa Nov 8, 2016

Copy link
Copy Markdown
Member Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sxa
sxa force-pushed the v4.x-sharedlib branch from 7bfa0f2 to 3123873 Compare November 8, 2016 12:04
@sxa
sxa force-pushed the v4.x-sharedlib branch from 3123873 to 004ff8b Compare November 8, 2016 12:05
bnoordhuis
bnoordhuis approved these changes Nov 8, 2016
View reviewed changes

@bnoordhuis bnoordhuis left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/node.h Outdated

@bnoordhuis bnoordhuis Nov 8, 2016

Copy link
Copy Markdown
Member

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sxa sxa Nov 8, 2016

Copy link
Copy Markdown
Member Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sxa
sxa force-pushed the v4.x-sharedlib branch from 004ff8b to b996628 Compare November 8, 2016 13:45
mhdawson
mhdawson reviewed Nov 8, 2016
View reviewed changes
Comment thread deps/v8/build/toolchain.gypi Outdated

@mhdawson mhdawson Nov 8, 2016

Copy link
Copy Markdown
Member

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 ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mhdawson
mhdawson suggested changes Nov 8, 2016
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tools/install.py Outdated

@mhdawson mhdawson Nov 8, 2016

Copy link
Copy Markdown
Member

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:

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread configure Outdated

@mhdawson mhdawson Nov 8, 2016

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sxa sxa Nov 9, 2016

Copy link
Copy Markdown
Member Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread vcbuild.bat Outdated

@mhdawson mhdawson Nov 8, 2016

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sxa sxa Nov 9, 2016

Copy link
Copy Markdown
Member Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sxa
sxa force-pushed the v4.x-sharedlib branch from 33f8729 to 9ae8f71 Compare November 9, 2016 17:02
@sxa sxa closed this Nov 17, 2016
@sxa
sxa force-pushed the v4.x-sharedlib branch from 004b1f2 to 2efe64e Compare November 17, 2016 11:31
@sxa sxa reopened this Nov 17, 2016
@sxa

sxa commented Nov 17, 2016

Copy link
Copy Markdown
Member Author

Updated with the V8 change (including version bump) as a separate commit as requested

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Nov 17, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Nov 17, 2016

Copy link
Copy Markdown
Contributor

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/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MylesBorins
MylesBorins approved these changes Nov 17, 2016
View reviewed changes
@sxa
sxa force-pushed the v4.x-sharedlib branch from fc912e8 to 8476b7c Compare November 18, 2016 14:01
@sxa

sxa commented Nov 18, 2016

Copy link
Copy Markdown
Member Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins
MylesBorins changed the base branch from v4.x to v4.x-staging November 18, 2016 18:24
@MylesBorins

MylesBorins commented Nov 18, 2016

Copy link
Copy Markdown
Contributor

@sxa555 sorry that this process keeps dragging out. it would appear you made this PR target v4.x when it should have been targeting v4.x-staging

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stefanmb and others added 4 commits November 18, 2016 18:45
@stefanmb Stewart Addison
build: cherry pick V8 change for windows DLL support
4a42b86
PR-URL: nodejs#8084
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@sxa Stewart Addison
build: configure --shared
a39212e
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 <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>

Reference:  nodejs#7487
Stewart Addison
build: windows sharedlib support
d0078bc
Stewart Addison
build: abstract out shared library suffix
28dc711
WIP: Add soname & fix make install

PR-URL: nodejs#6994
Ref: nodejs#9385
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>

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 <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@sxa
sxa force-pushed the v4.x-sharedlib branch from 8476b7c to 28dc711 Compare November 18, 2016 18:52
@sxa

sxa commented Nov 18, 2016

Copy link
Copy Markdown
Member Author

Now resolved :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins

MylesBorins commented Nov 18, 2016

Copy link
Copy Markdown
Contributor

One more CI run

https://ci.nodejs.org/job/node-test-pull-request/4891/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MylesBorins pushed a commit that referenced this pull request Nov 18, 2016
@stefanmb Myles Borins
build: cherry pick V8 change for windows DLL support
bb2fdf5
Ref: #9385
PR-URL: #8084
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 18, 2016
@sxa Myles Borins
build: configure --shared
f21c2b9
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 <[email protected]>
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 18, 2016
Stewart Addison Myles Borins
build: windows sharedlib support
0138b4d
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 <[email protected]>
  Reviewed-By: Michael Dawson <[email protected]>

PR-URL: #9385
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 18, 2016
Stewart Addison Myles Borins
build: abstract out shared library suffix
e97723b
Originally part of 410296c abstracted out in backport

PR-URL: #9385
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
@MylesBorins

MylesBorins commented Nov 18, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

landed in 527db40...e97723b

gibfahn reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins MylesBorins closed this Nov 18, 2016
@MylesBorins MylesBorins removed this from the 4.7.0 milestone Nov 22, 2016
@MylesBorins MylesBorins mentioned this pull request Nov 22, 2016
v4.7.0 proposal #9736
Merged
BethGriggs pushed a commit to ibmruntimes/node that referenced this pull request Dec 7, 2016
@stefanmb @BethGriggs
build: cherry pick V8 change for windows DLL support
97e68d8
Ref: nodejs/node#9385
PR-URL: nodejs/node#8084
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@springmeyer springmeyer mentioned this pull request May 20, 2017
Build failing for node v6.5.0 on windows mapnik/node-mapnik#691
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
+2 more reviewers
@MylesBorins MylesBorins MylesBorins approved these changes
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. c++ Issues and PRs that require attention from people who are familiar with C++. tools Issues and PRs related to the tools directory.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@sxa @jasnell @MylesBorins @mhdawson @bnoordhuis @nodejs-github-bot @stefanmb
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.