Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

sxa
Copy link
Member

@sxa sxa commented Jul 12, 2016

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

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Jul 12, 2016
@addaleax addaleax added the macos Issues and PRs related to the macOS platform / OSX. label Jul 12, 2016
@rvagg
Copy link
Member

rvagg commented Jul 13, 2016

sgtm, @nodejs/build?

# see the _InstallableTargetInstallPath function.
output_prefix += 'lib.target/'
output_file = 'lib' + output_file + '.so.' + get_version()
if sys.platform== 'darwin':
Copy link
Member

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.)

@bnoordhuis
Copy link
Member

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.

@sxa
Copy link
Member Author

sxa commented Jul 13, 2016

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.

@sxa
Copy link
Member Author

sxa commented Jul 15, 2016

@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']
Copy link
Member

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?

@ChALkeR
Copy link
Member

ChALkeR commented Jul 16, 2016

OS/X
OSX

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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: '.'

@bnoordhuis
Copy link
Member

bnoordhuis commented Jul 18, 2016

LGTM with nit. Can you rebase and squash?

EDIT: Note that the commit log should conform to the guidelines from CONTRIBUTING.md.

@sxa sxa force-pushed the sharedlib-osx branch 3 times, most recently from 2ca7ded to 4edb4cb Compare July 18, 2016 17:29
@sxa
Copy link
Member Author

sxa commented Jul 18, 2016

Should all be good now - have adjusted the commit log too.

@ChALkeR
Copy link
Member

ChALkeR commented Jul 18, 2016

The commit message should have a build: prefix on the first line.

@sxa sxa changed the title Add correct shared library naming on OS/X Add correct shared library naming on OS X Jul 19, 2016
@jasnell
Copy link
Member

jasnell commented Aug 4, 2016

@nodejs/build ... any further thoughts on this?
It LGTM

@bnoordhuis
Copy link
Member

Still LGTM but s/Add/add/ on the first line of the commit log. Whoever lands this can fix that up.

@jasnell
Copy link
Member

jasnell commented Aug 4, 2016

@mhdawson
Copy link
Member

mhdawson commented Aug 5, 2016

LGTM, @jasnell you planning to land ? I'll try to take a look tomorrow AM and land if you have not already.

@jasnell
Copy link
Member

jasnell commented Aug 5, 2016

Go for it. I'm stepping away from the laptop for a while tonight

On Thursday, August 4, 2016, Michael Dawson notifications@github.com
wrote:

LGTM, @jasnell https://github.com/jasnell you planning to land ? I'll
try to take a look tomorrow AM and land if you have not already.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7687 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAa2eQhzEGrPO9GlNaqzBH-B0woVNVYsks5qcpgZgaJpZM4JKqr2
.

@mhdawson
Copy link
Member

mhdawson commented Aug 5, 2016

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/

@mhdawson
Copy link
Member

mhdawson commented Aug 5, 2016

@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.

@jbergstroem
Copy link
Member

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.
mhdawson pushed a commit that referenced this pull request Aug 9, 2016
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>
@mhdawson
Copy link
Member

mhdawson commented Aug 9, 2016

Landed as a722205

@mhdawson mhdawson closed this Aug 9, 2016
@cjihrig cjihrig mentioned this pull request Aug 10, 2016
cjihrig pushed a commit that referenced this pull request Aug 10, 2016
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
@cjihrig cjihrig mentioned this pull request Aug 11, 2016
@MylesBorins
Copy link
Contributor

This is not landing cleanly on v4.x. Would someone be willing to do a manual backport?

@sxa
Copy link
Member Author

sxa commented Oct 4, 2016

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

@MylesBorins
Copy link
Contributor

ping @sxa555

@MylesBorins MylesBorins added this to the v4.6.2 milestone Oct 24, 2016
@sxa
Copy link
Member Author

sxa commented Oct 26, 2016

@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).

@MylesBorins
Copy link
Contributor

@sxa555 awesome! Keep me in the loop if you need any support at all

@MylesBorins MylesBorins modified the milestones: v4.7.0, v4.6.2 Oct 26, 2016
@MylesBorins MylesBorins removed this from the 4.7.0 milestone Nov 14, 2016
sxa pushed a commit to sxa/node that referenced this pull request Nov 16, 2016
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>
sxa pushed a commit to sxa/node that referenced this pull request Nov 16, 2016
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>
sxa pushed a commit to sxa/node that referenced this pull request Nov 18, 2016
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants