-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[service] macOS DYLD_LIBRARY_PATH removed due to System Integrity Protection #8443
Comments
I think conan-io/conan#7324 intends to solve this problem |
This is what I was looking for indeed 👍 I only searched conan center issues so I didn't see those PRs. Still I'm not exactly sure how the shell script wrappers can defeat macOS SIP as they also launch child processes which stips DYLD_* variables... |
DYLD_LIBRARY_PATH is not stripped if it passed directly to the process (on the same command line) |
Aha, got it. Thanks. |
macOS since 10.11 El Capitan strips
DYLD_LIBRARY_PATH
environment variable for child processes. It is a security measure called System Integrity Protection (SIP). This can cause issues with relocating Conan binary packages. Paricularly in CI.Take glib for example which includes
glib-compile-resources
tool that is linked with glib, gio and gobject libraries. Now originally CI built the binary package at/Users/jenkins/w/BuildSingleReference/.conan/data/glib/2.70.0/_/_/package/fa44afc4793c5d03aff181b297994be9fbcb275b
. However when building another library (aravis) glib got unpacked at/Users/jenkins/w/BuildSingleReference@2/.conan/data/glib/2.70.0/_/_/package/fa44afc4793c5d03aff181b297994be9fbcb275b
on the CI machine. Notice the@2
difference in path. As a result the dynamic library can no longer be found by full path. We could solve the problem by supplyingDYLD_LIBRARY_PATH
throughwith tools.environment_append(RunEnvironment(self).vars)
. Unfortunately the env variable is nuked due to SIP and library is not found with following error:See PR #8379 for an example where this is an issue.
Steps to reproduce:
glib:shared=True
.glib-compile-resources
with properDYLD_LIBRARY_PATH
.dyld: Library not loaded
withReason: image not found
Potential solutions:
@executable_path
relative locations for libraries. Likely a very complex fix in multiple packages.I made examples using glib here, but this bug affects all packages which have exeutables linked with dynamic libraries and are ran during build step of some other recipe.
The text was updated successfully, but these errors were encountered: