Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

rust 1.4.0 #45489

Closed
wants to merge 1 commit into from
Closed

rust 1.4.0 #45489

wants to merge 1 commit into from

Conversation

alex
Copy link
Contributor

@alex alex commented Oct 29, 2015

No description provided.

@DomT4
Copy link
Member

DomT4 commented Oct 29, 2015

Punting this off the CI queue for a few minutes whilst I bump the timeout.

@DomT4
Copy link
Member

DomT4 commented Oct 29, 2015

Back in the queue.

@alex
Copy link
Contributor Author

alex commented Oct 29, 2015

thanks!

@ghost
Copy link

ghost commented Oct 29, 2015

@alex: What version of Mac OS X are you running? I tried out similar changes on 10.11.1 'El Capitan' and I get an error:

note: Undefined symbols for architecture x86_64:
  "_EVP_aes_256_ctr", referenced from:
      _libssh2_crypt_method_aes256_ctr in liblibssh2_sys-3d2e39bd460070f9.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_256_ctr)
  "_EVP_aes_192_ctr", referenced from:
      _libssh2_crypt_method_aes192_ctr in liblibssh2_sys-3d2e39bd460070f9.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_192_ctr)
  "_EVP_aes_128_ctr", referenced from:
      _libssh2_crypt_method_aes128_ctr in liblibssh2_sys-3d2e39bd460070f9.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_128_ctr)
ld: symbol(s) not found for architecture x86_64

@alex
Copy link
Contributor Author

alex commented Oct 30, 2015

@dtrebbien Not sure what would cause that, it looks green on CI

@ghost
Copy link

ghost commented Oct 30, 2015

Hmmm. I tried your patch exactly and I still get the same errors.

@DomT4
Copy link
Member

DomT4 commented Oct 30, 2015

The only thing I can think of here is that @dtrebbien is building outside /usr/local where we've seen some issues reported upstream before, such as rust-lang/rust#29133.

@ghost
Copy link

ghost commented Oct 30, 2015

I am running the brew install command within ~/Documents/Projects/build. Is that what you mean by "building outside /usr/local"?

Homebrew is installed to /usr/local.

@DomT4
Copy link
Member

DomT4 commented Oct 31, 2015

@dtrebbien Can you generate a brew gist-logs for this version of rust then? Thanks.

@ghost
Copy link

ghost commented Oct 31, 2015

@ghost
Copy link

ghost commented Oct 31, 2015

In my case, the Rust libssh2-sys library is building its own copy of libssh2 using CMake. The libssh2 CMake build script checks for the existence of the EVP_aes_128_ctr() function in OpenSSL's libcrypto. If found, then libssh2 will use that function; otherwise, libssh2 provides an implementation. CMake is checking the Homebrew version of OpenSSL (/usr/local/Cellar/openssl/1.0.2d_1/lib/libcrypto.dylib), and therefore the function existence check succeeds. However, when cargo is linked, the library search paths are set up such that /usr/lib is searched before /usr/local/Cellar/openssl/1.0.2d_1/lib. Because /usr/lib/libcrypto.dylib is missing the EVP_aes_128_ctr() function, the missing symbol errors occur.

Can others check their /usr/lib/libcrypto.dylib for the _EVP_aes_128_ctr symbol:

nm -a /usr/lib/libcrypto.dylib

I have not modified this file on my system, so I am not sure why the cargo link step fails on my system, but succeeds on other 'El Capitan' systems.

A fix for my system is to add a dependency on libssh2 to the formula. This causes the Rust libssh2-sys library not to build its own copy of libssh2:

depends_on "libssh2"

@MikeMcQuaid
Copy link
Member

A fix for my system is to add a dependency on libssh2 to the formula. This causes the Rust libssh2-sys library not to build its own copy of libssh2:

This seems OK 👍

@DomT4
Copy link
Member

DomT4 commented Nov 1, 2015

I have not modified this file on my system, so I am not sure why the cargo link step fails on my system, but succeeds on other 'El Capitan' systems.

You don't have the CLT installed, is the obvious detail. All the CIs ship both Xcode and CLT, so it would pass there if that was the case.

@ghost
Copy link

ghost commented Nov 3, 2015

Hi @alex, did you want to push an amended commit with the extra depends_on "libssh2" line?

@alex
Copy link
Contributor Author

alex commented Nov 3, 2015

I'm not sure I understand why rust needs to depend on libssh2, it doesn't use it all, that's an external crate as far as I can tell?

@ghost
Copy link

ghost commented Nov 3, 2015

cargo appears to have a dependency on the libssh2-sys Rust package. If libssh2 is not installed (findable via pkg-config), then libssh2-sys builds libssh2 from source using CMake. The libssh2 built by libssh2-sys is meant to be linked with the Homebrew OpenSSL libs, but what can happen is the older-version Mac OS X OpenSSL libs are linked instead, causing missing symbol errors.

Adding a dependency on libssh2 to the formula just makes sure that the Homebrew OpenSSL libs are used.

@alex
Copy link
Contributor Author

alex commented Nov 3, 2015

Ahhh, ok, it's cargo itself. I'll add libssh2 as a dependency then. Thanks for clarifiying.

@DomT4
Copy link
Member

DomT4 commented Nov 3, 2015

Would you mind squashing this and rebasing it against the master? Several of us have tried to pull it locally but we're getting git error messages 😢.

@DomT4 DomT4 removed the CI-requeued label Nov 3, 2015
@alex
Copy link
Contributor Author

alex commented Nov 4, 2015

@DomT4 done

@DomT4
Copy link
Member

DomT4 commented Nov 4, 2015

That did the trick. Merged in 517aac3.

Thank you for another contribution to Homebrew @alex; we appreciate it! 😺

@DomT4 DomT4 closed this in 517aac3 Nov 4, 2015
@alex alex deleted the patch-1 branch November 4, 2015 12:05
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants