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
tickets/DM-5753: XCode 7.3 is broken #14
Conversation
@@ -172,14 +172,20 @@ def _initEnvironment(): | |||
if env['PLATFORM'] == 'darwin': | |||
env['LDMODULESUFFIX'] = ".so" | |||
if not re.search(r"-install_name", str(env['SHLINKFLAGS'])): | |||
env.Append(SHLINKFLAGS=["-Wl,-install_name", "-Wl,${TARGET.file}"]) | |||
env.Append(SHLINKFLAGS=["-install_name", "@rpath/${TARGET.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.
Not obvious if @rpath/libfoo.dylib
is the right solution here. I think this implies we're putting all our libraries into some joint lib
(or that we'll be adding a lot of RPATHs into the executables, for each per-product lib)?
It don't think it matters with the current DYLD_...
EUPS scheme. But will make it impossible for conda-build
to infer the proper install_name
from $PREFIX
, which may make it more difficult to do an EUPS-less install.
I'd propose to leave it as-is until we have a firmer grasp about what's the right thing to do (probably as a part of developing an EUPS-less install?).
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.
As you say, adding @rpath
is a no-op when you set DYLD_LIBRARY_PATH
as the linker always searches that path first regardless of any path burned into the library. I don't quite understand what you are saying about proper $PREFIX
because we don't currently set any prefix at all in the install name and furthermore conda-build
explicitly goes in and changes all our library install names to use @rpath
. From reading the notes about @rpath
I was under the impression that adding @rpath
was the only way to allow people to reliably use your libraries if they aren't setting DYLD_LIBRARY_PATH
because they can set the search path in the binaries explicitly and indirect dependent libraries will know to also use that search path. Most of the packages outside of EUPS do already do what this patch does (see e.g. boost).
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.
PS I'm not going to fight this. I'm okay with adjusting the patch so it just cleans up the -Wl
stuff. I'll see what @jdswinbank says when he reviews it.
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.
I've never used conda-build
, and I'm not sure I understand the point that @mjuric is raising here -- my beginner-level grasp of how this is supposed to work agrees with @timj.
However: this doesn't seem like it's directly related to the issue at hand, it doesn't solve a problem we're having this week, and if there's a risk it could interfere with the Anaconda build, my suggestion is to drop it.
Always add the trailing slash even in older XCode versions. Can remove this change when Apple fix XCode.
There is no need to use -Wl, to pass "-install_name" to the linker. Clang on OS X already knows how to do this so the command line looks cleaner without it.
@timj, @jdswinbank: Sorry I wasn't very clear in my comment on With The issue is that if you set the It's better to instead agree upon a fixed point in the filesystem, only store the path to that point as the RPATH in your binaries, and encode The key bit is that Right now this is all a moot point, as Anyways, to make a long story short, we will want to change the |
Thanks, @mjuric, for taking the time to explain that. |
Provides a workaround on OSX for the bug linking indirect libraries on OS X. Since I was messing with that code there is a second commit that cleans up the -install_name option and also switches that to use @rpath (which seems to be the recommended thing to do on OS X).