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

nightly cargo dyn linking to openssl fails on os x #3303

Closed
paulsmith opened this issue Nov 19, 2016 · 3 comments · Fixed by #3311
Closed

nightly cargo dyn linking to openssl fails on os x #3303

paulsmith opened this issue Nov 19, 2016 · 3 comments · Fixed by #3311

Comments

@paulsmith
Copy link

system: OS X El Capitan 10.11.6

I installed rustup via https://www.rustup.rs/ choosing x86_64-apple-darwin and nightly. Installation succeeded, but then executing cargo failed with the following:

$ cargo
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/moof/.multirust/toolchains/nightly-x86_64-apple-darwin/bin/cargo
  Reason: image not found

Missing dyn lib: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

output of otool -L:

$ otool -L /Users/moof/.multirust/toolchains/nightly-x86_64-apple-darwin/bin/cargo
/Users/moof/.multirust/toolchains/nightly-x86_64-apple-darwin/bin/cargo:
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57031.20.26)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0)
	/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

Discussion in #rust-beginners pointed out that /usr/local/opt/openssl is a symlink into /usr/local/Cellar, indicating that nightly cargo may have recently (inadvertently?) created a dependency on Homebrew.

@causal-agent
Copy link

For comparison, output of otool -L on stable Cargo:

/Users/curtis/.multirust/toolchains/stable-x86_64-apple-darwin/bin/cargo:
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57031.20.26)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0)
    /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
    /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

@alexcrichton
Copy link
Member

Ah yes this happened recently due to upgrading to openssl-sys 0.9. I need to modify the builders of the OSX nightlies to prefer a static linking of OpenSSL than a dynamic.

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Nov 21, 2016
Now that Cargo requires OpenSSL >= 1.0.1 transitively through the `openssl-sys`
0.9 release the dynamic libraries for OpenSSL are no longer located on OSX by
default. This means that the support necessary for libssh2 needs to be
statically linked rather than dynamically linked.

Closes rust-lang#3303
bors added a commit that referenced this issue Nov 21, 2016
Link OpenSSL statically on OSX

Now that Cargo requires OpenSSL >= 1.0.1 transitively through the `openssl-sys`
0.9 release the dynamic libraries for OpenSSL are no longer located on OSX by
default. This means that the support necessary for libssh2 needs to be
statically linked rather than dynamically linked.

Closes #3303
@remram44
Copy link

Nightly 2016-11-25 works, thanks!

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Dec 1, 2016
Now that Cargo requires OpenSSL >= 1.0.1 transitively through the `openssl-sys`
0.9 release the dynamic libraries for OpenSSL are no longer located on OSX by
default. This means that the support necessary for libssh2 needs to be
statically linked rather than dynamically linked.

Closes rust-lang#3303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants