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 #3353

Merged
merged 12 commits into from Dec 2, 2016
Merged

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Dec 1, 2016

This is a backport of the following PRs to fix the actual issue, rust-lang/rust#37969.

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)

@rust-highfive
Copy link

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against rust-1.14.0. Please double check that you specified the right target!

@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

📌 Commit 6eb113a has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

⌛ Testing commit 6eb113a with merge f91900c...

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

💔 Test failed - status-travis

tbu- and others added 3 commits December 1, 2016 09:53
This updates libgit2/libssh2 bindings to fix initialization races in
OpenSSL. This should fix some of the spurious segfaults we've been
seeing on Travis OSX.
This commit includes alexcrichton/git2-rs@a8f4a7faa which switches the order of
initialization of libgit2. That commit ensures that the relevant env vars which
a statically linked OpenSSL needs to function are set before libgit2 is
initialized to ensure that libgit2 uses them.

This was regressed accidentally in alexcrichton/git2-rs@071902aa when
initialization was tweaked.

Closes rust-lang#3340
@alexcrichton
Copy link
Member Author

Looks like that's another flaky test on OSX. That was fixed in #3331 which requires backporting #3326 as well. Those two PRs introduced a regression, however, which was fixed in #3342. I've now backported all three.

Need to optionally chop off the `deps` folder if it's there to get to the
location we're expecting.
@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

📌 Commit 1bb340e has been approved by alexcrichton

@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

📌 Commit adf9312 has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

⌛ Testing commit adf9312 with merge 2ada218...

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

💔 Test failed - status-appveyor

@alexcrichton
Copy link
Member Author

@bors: retry

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

⌛ Testing commit adf9312 with merge 6423f34...

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

💔 Test failed - status-travis

@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

📌 Commit ea380cf has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

⌛ Testing commit ea380cf with merge cf0b0bc...

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

💔 Test failed - status-travis

Stable cargos don't need to be compatible with nightlies
@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2016

📌 Commit 977f263 has been approved by alexcrichton

@alexcrichton
Copy link
Member Author

@bors: p=1

@bors
Copy link
Collaborator

bors commented Dec 2, 2016

⌛ Testing commit 977f263 with merge 8d63784...

bors added a commit that referenced this pull request Dec 2, 2016
Backporting fixes to 1.14.0

This is a backport of the following PRs to fix the actual issue, rust-lang/rust#37969.

* #3311 - first attempt to fix OpenSSL linkage on OSX
* #3315 - second attempt to fix linkage
* #3325 - fix a flaky test causing lots of CI problems
* #3332 - actual fix for OpenSSL linkage on OSX
* #3345 - first PR for automation changes
* #3350 - second PR for automation changes
* #3326 - update git2 to support netbsd
* #3331 - update git2 to fix segfaults in tests
* #3342 - update git2 to fix cert paths
@bors
Copy link
Collaborator

bors commented Dec 2, 2016

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 8d63784 to rust-1.14.0...

@bors bors merged commit 977f263 into rust-lang:rust-1.14.0 Dec 2, 2016
@alexcrichton alexcrichton deleted the 1.14.0-next branch December 2, 2016 06:48
@ehuss ehuss added this to the 1.14.0 milestone Feb 6, 2022
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.

None yet

6 participants