Cargo: OpenSSL linking errors on OS X

Created on 19 Jan 2016  Â·  14Comments  Â·  Source: rust-lang/cargo

On OS X 10.11 with OpenSSL installed by brew install openssl; brew link openssl --force

Johns-MacBook-Pro:cargo John$ ./configure 
configure: looking for configure programs
configure: found cmp
configure: found mkdir
configure: found printf
configure: found cut
configure: found head
configure: found grep
configure: found xargs
configure: found cp
configure: found find
configure: found uname
configure: found date
configure: found tr
configure: found sed
configure: found cmake
configure: found curl
configure: recreating config.tmp
configure: 
configure: processing ./configure args
configure: 
configure: CFG_PREFIX           := /usr/local 
configure: CFG_LOCAL_RUST_ROOT  :=  
configure: CFG_RUSTC            :=  
configure: error: needed, but unable to find any of: CFG_RUSTC rustc
Johns-MacBook-Pro:cargo John$ ./configure --local-rust-root="$PWD"/rustc
configure: looking for configure programs
configure: found cmp
configure: found mkdir
configure: found printf
configure: found cut
configure: found head
configure: found grep
configure: found xargs
configure: found cp
configure: found find
configure: found uname
configure: found date
configure: found tr
configure: found sed
configure: found cmake
configure: found curl
configure: recreating config.tmp
configure: 
configure: processing ./configure args
configure: 
configure: CFG_PREFIX           := /usr/local 
configure: CFG_LOCAL_RUST_ROOT  := /Users/John/Documents/dev/cargo/rus ...
configure: 
configure: using rustc at: /Users/John/Documents/dev/cargo/rustc with version: rustc 1.6.0-nightly (52d95e644 2015-11-30)
configure: 
configure: CFG_BUILD            := x86_64-apple-darwin 
configure: CFG_HOST             := x86_64-apple-darwin 
configure: CFG_TARGET           := x86_64-apple-darwin 
configure: CFG_LOCALSTATEDIR    := /var/lib 
configure: CFG_SYSCONFDIR       := /etc 
configure: CFG_DATADIR          := /usr/local/share 
configure: CFG_INFODIR          := /usr/local/share/info 
configure: CFG_MANDIR           := /usr/local/share/man 
configure: CFG_LIBDIR           := /usr/local/lib 
configure: CFG_LOCAL_CARGO      :=  
configure: 
configure: validating ./configure args
configure: 
configure: 
configure: looking for build programs
configure: 
configure: CFG_CURLORWGET       := /usr/bin/curl (curl 7.43.0 (x86_64-apple-darwin15.0) libcurl/7.43.0 SecureTransport zlib/1.2.5)
configure: CFG_PYTHON           := /usr/bin/python 
configure: CFG_CC               := /usr/bin/cc (Apple LLVM version 7.0.2 (clang-700.1.81))
configure: 
configure: writing configuration
configure: 
configure: CFG_SRC_DIR          := /Users/John/Documents/dev/cargo/ 
configure: CFG_BUILD_DIR        := /Users/John/Documents/dev/cargo/ 
configure: CFG_CONFIGURE_ARGS   := --local-rust-root=/Users/John/Docum ...
configure: CFG_PREFIX           := /usr/local 
configure: CFG_BUILD            := x86_64-apple-darwin 
configure: CFG_HOST             := x86_64-apple-darwin 
configure: CFG_TARGET           := x86_64-apple-darwin 
configure: CFG_LIBDIR           := /usr/local/lib 
configure: CFG_MANDIR           := /usr/local/share/man 
configure: CFG_RUSTC            := /Users/John/Documents/dev/cargo/rus ...
configure: CFG_RUSTDOC          := /Users/John/Documents/dev/cargo/rus ...
configure: 
configure: cp /Users/John/Documents/dev/cargo/Makefile.in ./Makefile
configure: mv config.tmp config.mk
configure: 
configure: complete
configure: 
configure: 
Johns-MacBook-Pro:cargo John$ make 
/usr/bin/python src/etc/dl-snapshot.py x86_64-apple-darwin
running: curl -o target/dl/cargo-nightly-x86_64-apple-darwin.tar.gz https://static.rust-lang.org/cargo-dist/2015-04-02/cargo-nightly-x86_64-apple-darwin.tar.gz
extracting cargo-nightly-x86_64-apple-darwin/cargo/manifest.in
extracting cargo-nightly-x86_64-apple-darwin/cargo/share/zsh/site-functions/_cargo
extracting cargo-nightly-x86_64-apple-darwin/cargo/share/man/man1/cargo.1
extracting cargo-nightly-x86_64-apple-darwin/cargo/share/doc/cargo/LICENSE-APACHE
extracting cargo-nightly-x86_64-apple-darwin/cargo/share/doc/cargo/LICENSE-MIT
extracting cargo-nightly-x86_64-apple-darwin/cargo/share/doc/cargo/LICENSE-THIRD-PARTY
extracting cargo-nightly-x86_64-apple-darwin/cargo/share/doc/cargo/README.md
extracting cargo-nightly-x86_64-apple-darwin/cargo/etc/bash_completion.d/cargo
extracting cargo-nightly-x86_64-apple-darwin/cargo/bin/cargo
touch target/snapshot/bin/cargo
/Users/John/Documents/dev/cargo/rustc/bin/rustc -V
rustc 1.6.0-nightly (52d95e644 2015-11-30)
target/snapshot/bin/cargo --version
cargo 0.0.1-pre-nightly (84d6d2c 2015-03-31) (built 2015-04-01)
target/snapshot/bin/cargo build --target x86_64-apple-darwin --release  
   Compiling libc v0.2.4
   Compiling winapi v0.2.5
   Compiling crossbeam v0.1.6
   Compiling strsim v0.3.0
   Compiling regex-syntax v0.2.2
   Compiling matches v0.1.2
   Compiling semver v0.2.0
   Compiling rustc-serialize v0.3.16
   Compiling winapi-build v0.1.1
   Compiling gcc v0.3.21
   Compiling bitflags v0.1.1
   Compiling pkg-config v0.3.6
   Compiling glob v0.2.10
   Compiling memchr v0.1.7
   Compiling log v0.3.4
   Compiling advapi32-sys v0.1.2
   Compiling kernel32-sys v0.1.4
   Compiling kernel32-sys v0.2.1
   Compiling ws2_32-sys v0.2.1
   Compiling cmake v0.1.12
   Compiling miniz-sys v0.1.7
   Compiling openssl-sys v0.7.4
   Compiling libz-sys v1.0.0
   Compiling curl-sys v0.1.29
   Compiling aho-corasick v0.4.0
   Compiling libgit2-sys v0.3.8
   Compiling libssh2-sys v0.1.34
   Compiling regex v0.1.44
   Compiling rand v0.3.13
   Compiling filetime v0.1.8
   Compiling term v0.2.14
   Compiling time v0.1.34
   Compiling num_cpus v0.2.10
   Compiling tar v0.3.2
   Compiling env_logger v0.3.2
   Compiling flate2 v0.2.11
   Compiling docopt v0.6.78
   Compiling toml v0.1.25
   Compiling uuid v0.1.18
   Compiling url v0.2.38
   Compiling curl v0.2.14
   Compiling git2 v0.3.3
   Compiling crates-io v0.1.0 (file:///Users/John/Documents/dev/cargo)
   Compiling git2-curl v0.3.0
   Compiling cargo v0.8.0 (file:///Users/John/Documents/dev/cargo)
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/cargo.0.o" "-o" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/cargo" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release" "-L" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps" "-L" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/build/libgit2-sys-0404a3bd55be7403/out/lib" "-L" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/build/libssh2-sys-b1f216ef589edc64/out/lib" "-L" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/build/miniz-sys-e18c2d499e3735f1/out" "-L" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libenv_logger-d6da5efc2eeb1aae.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libgit2_curl-11104f71ff1c41d0.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/libcargo-01b73c5a48ff844f.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libterm-6cad015316ad4ae7.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libglob-d67ece25280f9940.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libdocopt-faa69fef8d438b9a.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libstrsim-fb046b3f6ce0ea34.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libtime-0e91bfb1f79fb53d.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libflate2-84023fb450349961.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libregex-dcf1373a2774b1ba.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libregex_syntax-9b75673cb7c1244f.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libnum_cpus-b448f5baad66a4bf.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libminiz_sys-e18c2d499e3735f1.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libcrates_io-3de6587996ee8c97.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libcurl-56bb07201f9e5377.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/liblog-30eb08334131e1e8.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libcurl_sys-75e398c169b46f50.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libtar-ac2e82993394c3b8.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libcrossbeam-e17458a1a0cc18c3.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libaho_corasick-f9653b05189d1432.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libmemchr-d6e3bbb840294241.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libsemver-ee8f779269173b7c.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libfiletime-a1c649b1d4800b7b.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libkernel32-61a71c5c92824ffc.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libtoml-73a342f518b372dc.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libgit2-fcb8ae90fa569df2.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/liburl-64c4c5ba7f1199d8.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libuuid-36846d8887dd719f.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libmatches-68db25b520030534.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libbitflags-518ea12e21428edd.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/librand-8965ee540fd8a75e.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/librustc_serialize-45b943113dafb41a.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/liblibgit2_sys-0404a3bd55be7403.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/liblibssh2_sys-b1f216ef589edc64.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libopenssl_sys-aa16857ea360997e.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libwinapi-d1945403b981ba93.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/liblibz_sys-23034fc00741f52e.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/liblibc-c9bdc12d8fb6b7ac.rlib" "/Users/John/Documents/dev/cargo/target/x86_64-apple-darwin/release/deps/libws2_32-2f73d4d54486e748.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/libstd-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/libcollections-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/librand-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/liballoc-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/liblibc-8cf6ce90.rlib" "/Users/John/Documents/dev/cargo/rustc/lib/rustlib/x86_64-apple-darwin/lib/libcore-8cf6ce90.rlib" "-l" "curl" "-l" "iconv" "-l" "ssl" "-l" "crypto" "-l" "z" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
note: Undefined symbols for architecture x86_64:
  "_EVP_aes_256_ctr", referenced from:
      _libssh2_crypt_method_aes256_ctr in liblibssh2_sys-b1f216ef589edc64.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_256_ctr)
  "_SSLSetIOFuncs", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLSetSessionOption", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLSetProtocolVersionMin", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLSetProtocolVersionMax", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLSetPeerDomainName", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLClose", referenced from:
      _stransport_close in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_EVP_aes_192_ctr", referenced from:
      _libssh2_crypt_method_aes192_ctr in liblibssh2_sys-b1f216ef589edc64.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_192_ctr)
  "_SSLRead", referenced from:
      _stransport_read in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SecTrustGetCertificateAtIndex", referenced from:
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLSetConnection", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SecCertificateCopyData", referenced from:
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_CFDataGetBytePtr", referenced from:
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLHandshake", referenced from:
      _stransport_connect in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SecTrustEvaluate", referenced from:
      _stransport_connect in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SecCopyErrorMessageString", referenced from:
      _stransport_connect in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_write in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_read in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_close in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_CFDataGetLength", referenced from:
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_EVP_aes_128_ctr", referenced from:
      _libssh2_crypt_method_aes128_ctr in liblibssh2_sys-b1f216ef589edc64.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_128_ctr)
  "_SSLCreateContext", referenced from:
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_CFStringGetCStringPtr", referenced from:
      _stransport_connect in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_write in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_read in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_close in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLWrite", referenced from:
      _stransport_write in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_SSLCopyPeerTrust", referenced from:
      _stransport_connect in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
  "_CFRelease", referenced from:
      _stransport_connect in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_certificate in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_write in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_read in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_close in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _stransport_free in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      _git_stransport_stream_new in liblibgit2_sys-0404a3bd55be7403.rlib(stransport_stream.c.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
Could not compile `cargo`.

To learn more, run the command again with --verbose.
make: *** [cargo-x86_64-apple-darwin] Error 101

Most helpful comment

@Zoxc assuming you have already:

    brew install openssl

then you just need to export some variables

if you are using bash:

    export OPENSSL_ROOT_DIR=$(brew --prefix openssl)
    export OPENSSL_LIB_DIR=$(brew --prefix openssl)"/lib"
    export OPENSSL_INCLUDE_DIR=$(brew --prefix openssl)"/include"

if you are using fish:

    set -x OPENSSL_ROOT_DIR (brew --prefix openssl)
    set -x OPENSSL_LIB_DIR (brew --prefix openssl)"/lib"
    set -x OPENSSL_INCLUDE_DIR (brew --prefix openssl)"/include"

then rebuild.

All 14 comments

I just published libgit2-sys 0.3.9 which I believe should fix this, can you try that out?

Same issue here, but I have updated the libgit2-sys version to 0.3.9 and still it fails to compile :(

/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:657:13: 657:39 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:657             raw::GIT_DIFF_LINE_CONTEXT => ' ',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:657:13: 657:39 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:658:13: 658:40 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:658             raw::GIT_DIFF_LINE_ADDITION => '+',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:658:13: 658:40 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:659:13: 659:40 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:659             raw::GIT_DIFF_LINE_DELETION => '-',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:659:13: 659:40 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:660:13: 660:45 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:660             raw::GIT_DIFF_LINE_CONTEXT_EOFNL => '=',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:660:13: 660:45 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:661:13: 661:41 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:661             raw::GIT_DIFF_LINE_ADD_EOFNL => '>',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:661:13: 661:41 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:662:13: 662:41 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:662             raw::GIT_DIFF_LINE_DEL_EOFNL => '<',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:662:13: 662:41 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:663:13: 663:40 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:663             raw::GIT_DIFF_LINE_FILE_HDR => 'F',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:663:13: 663:40 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:664:13: 664:40 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:664             raw::GIT_DIFF_LINE_HUNK_HDR => 'H',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:664:13: 664:40 help: run `rustc --explain E0308` to see a detailed explanation
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:665:13: 665:38 error: mismatched types:
 expected `i8`,
    found `u32`
(expected i8,
    found u32) [E0308]
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:665             raw::GIT_DIFF_LINE_BINARY => 'B',
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/kagia/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.3.3/src/diff.rs:665:13: 665:38 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 9 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `git2`.

@kagia can you try updating the git2 dependency as well?

@alexcrichton I thought I was already using the latest version git2 0.3.3 no?

Oh oops forgot to publish that one as well, try again now?

@alexcrichton it's still not compiling, although the error message is significantly shorter now.

note: Undefined symbols for architecture x86_64:
  "_EVP_aes_256_ctr", referenced from:
      _libssh2_crypt_method_aes256_ctr in liblibssh2_sys-b1f216ef589edc64.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-b1f216ef589edc64.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-b1f216ef589edc64.rlib(crypt.c.o)
     (maybe you meant: __libssh2_EVP_aes_128_ctr)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
Could not compile `cargo`.

Oh that's probably related to openssl shenanigans on OSX 10.11 by default, you can read up more information about that here

@alexcrichton yes, it builds perfectly now!

Thanks!!

@kagia What did you do to resolve the final linking errors?

@Zoxc assuming you have already:

    brew install openssl

then you just need to export some variables

if you are using bash:

    export OPENSSL_ROOT_DIR=$(brew --prefix openssl)
    export OPENSSL_LIB_DIR=$(brew --prefix openssl)"/lib"
    export OPENSSL_INCLUDE_DIR=$(brew --prefix openssl)"/include"

if you are using fish:

    set -x OPENSSL_ROOT_DIR (brew --prefix openssl)
    set -x OPENSSL_LIB_DIR (brew --prefix openssl)"/lib"
    set -x OPENSSL_INCLUDE_DIR (brew --prefix openssl)"/include"

then rebuild.

Well, that worked. @alexcrichton Can you update Cargo.lock?

I started seeing this on nightly builds of semver last night, even not on
OSX.

On Wed, Jan 20, 2016 at 5:11 AM, Zoxc [email protected] wrote:

Well, that worked. @alexcrichton https://github.com/alexcrichton Can
you update Cargo.lock?

—
Reply to this email directly or view it on GitHub
https://github.com/rust-lang/cargo/issues/2295#issuecomment-173156297.

Oh, wait, sorry, I guess my git2 was a release behind...

On Wed, Jan 20, 2016 at 9:21 AM, Steve Klabnik [email protected]
wrote:

I started seeing this on nightly builds of semver last night, even not on
OSX.

On Wed, Jan 20, 2016 at 5:11 AM, Zoxc [email protected] wrote:

Well, that worked. @alexcrichton https://github.com/alexcrichton Can
you update Cargo.lock?

—
Reply to this email directly or view it on GitHub
https://github.com/rust-lang/cargo/issues/2295#issuecomment-173156297.

Thanks! I ran in to this today. The linking cleared it up. I just wanted to add in that I needed to run

cargo clean

to get the new values to work.

Was this page helpful?
0 / 5 - 0 ratings