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

Backporting fixes to 1.14.0 #3352

Closed
wants to merge 6 commits into from

Conversation

alexcrichton
Copy link
Member

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
After rust-lang#3311 we're now correctly trying to link OpenSSL statically on
OSX. Unfortunately though this is failing to complete on the builders.
Turns out the way we install OpenSSL through Homebrew create "universal
archives" which is essentially an archive with both i686 and x86_64
object files, but separated. The linker takes care of this just fine but
rustc currently chokes on it, unable to include the library statically
into the compiler.

To work around this we prepare our own mini install of OpenSSL by
copying relevant bits into a local directory (like we do on Linux). As
part of this we use the `lipo` tool, which is used to manage these fat
archives, to disassemble the archive and only extract the relevant
architecture. This should make a pre-installation step which both
extracts the information and configures Cargo to use it.

This should also fix the errors we're seeing on Travis I believe.
We can't rely on frobbing mtimes, need to actually just wait a whole
second.
I'm seeing a bunch of weird illegal instructions on OSX nightlies for
Cargo. My guess is that they're all related to OpenSSL linking. Right
now we're linking from Homebrew but I have a sneaking suspicion that it
compiles with `-march=native` rather than what we'd like as a portable
binary. To work around this compile OpenSSL ourselves and link it that
way.

Note that I believe this won't bring in the certificate trust store of
OpenSSL on OSX (or at least not the right one from the keychain). We
shouldn't need that, however, as OpenSSL is just used as the
cryptographic primitives in libssh2 and Cargo itself. So in that sense
we shouldn't need it for actually SSL at all.
Follow the same strategy as the compiler for now in basically every respect:

* Add new `--release-channel` configure option, defaulting to `dev`
* Remove old `--enable-nightly`
* Add `--enable-build-openssl` as an orthogonal option
* Hook up Travis/AppVeyor to stable/beta/master branches to do the right
  channel builds.
* Pass `--quiet` to all tests to have some quieter output
* Skip builds on branches other than `auto-cargo` as it's already checked
* Check the right env var for repo branches on appveyor
* Only run a few builds on PRs
@rust-highfive
Copy link

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

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 this pull request may close these issues.

3 participants