-
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
Add correct shared library naming on OS X #7687
Conversation
sgtm, @nodejs/build? |
# see the _InstallableTargetInstallPath function. | ||
output_prefix += 'lib.target/' | ||
output_file = 'lib' + output_file + '.so.' + get_version() | ||
if sys.platform== 'darwin': |
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.
Style: space before ==
. You can fold the if
into the preceding else
, saves a level of indent.
(In case you're not a pythonista, the keyword is elif
.)
It's kind of nasty to duplicate the logic in two places. It's arguably better to set a variable in configure and use that. |
True @bnoordhuis - I was just following the same pattern that was already in place for splitting Windows/Linux. I'll look at modifying it to use a variable for the shlib filename as you suggest (although it may still be cleaner overall to have the darwin-specific switch for the directory prefix in install.py instead of having that passed through) I'm looking separately at AIX too which generally uses .a as the suffix so abstracting this out as you suggest will make that simpler. |
@bnoordhuis Updates done to have the shared lib suffixes differences only into configure. In theory we could abstract this over windows as well and use a prefix variable too, but I'd propose that be done separately if we want it. |
@@ -842,6 +842,11 @@ def configure_node(o): | |||
o['variables']['node_shared'] = b(options.shared) | |||
o['variables']['node_module_version'] = int(getmoduleversion.get_version()) | |||
|
|||
if sys.platform == 'darwin': | |||
o['variables']['shlib_suffix'] = '%s.dylib' % o['variables']['node_module_version'] |
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 lines stay < 80 columns?
Nit: «macOS». Or «OS X». |
# see the _InstallableTargetInstallPath function. | ||
output_prefix += 'lib.target/' | ||
output_file = 'lib' + output_file + '.so.' + get_version() | ||
output_file = 'lib' + output_file + "." + variables.get('shlib_suffix') |
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.
Style nit: '.'
LGTM with nit. Can you rebase and squash? EDIT: Note that the commit log should conform to the guidelines from CONTRIBUTING.md. |
2ca7ded
to
4edb4cb
Compare
Should all be good now - have adjusted the commit log too. |
The commit message should have a |
@nodejs/build ... any further thoughts on this? |
Still LGTM but s/Add/add/ on the first line of the commit log. Whoever lands this can fix that up. |
LGTM, @jasnell you planning to land ? I'll try to take a look tomorrow AM and land if you have not already. |
Go for it. I'm stepping away from the laptop for a while tonight On Thursday, August 4, 2016, Michael Dawson notifications@github.com
|
CI run had some failures, don't think they are related, but just in case: https://ci.nodejs.org/job/node-test-pull-request/3538/ |
@sxa555, Was just about to land but seems that the windows shared lib patch was landed and there is now a conflict. Can you rebase and then let me know and I'll land. |
LGTM with commit message nit (ref Bens comment) |
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.so 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.
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.so 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: #7687 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Landed as a722205 |
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.so 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: #7687 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Conflicts: node.gyp
This is not landing cleanly on v4.x. Would someone be willing to do a manual backport? |
@thealphanerd Yeah I'll take a look at it - I have a set of changes kicking around that I've used to get it working on V4 already. It was on my list to push them back when I get some time :-) |
ping @sxa555 |
@thealphanerd ping accepted :-) We don't currently have any of the shared library stuff in v4.x so it's not a trivial matter of just doing the name change for OS/X. I do want to get it into V4 though and have got a bit of time for it now (and as per earlier comment I have had it working - just need to get a PR in for it). |
@sxa555 awesome! Keep me in the loop if you need any support at all |
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>
PR-URL: nodejs#7687 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>
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>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Build system
Description of change
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 change modifies 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. Without these changes,
"make binary" with CONFIG_FLAGS=--shared fails on the install.py step