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

Fails to compile when libiconv is installed via MacPorts [upstream] #256

Closed
valin4tor opened this issue Feb 16, 2021 · 2 comments
Closed
Labels

Comments

@valin4tor
Copy link

valin4tor commented Feb 16, 2021

How to reproduce:

  1. Use an Apple Silicon Mac Install libiconv with MacPorts: sudo port install libiconv (or something which depends on it)
  2. Run cargo install cargo-outdated or cargo install --locked cargo-outdated

Expected result:

The crate installs successfully

Actual result:

   Compiling cargo-outdated v0.9.14
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-arch" "arm64" "-L" "/Users/david/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/deps/cargo_outdated-c4ee5d7a9cf983a4.cargo_outdated.41ebcblh-cgu.15.rcgu.o" "-o" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/deps/cargo_outdated-c4ee5d7a9cf983a4" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/deps" "-L" "/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/lib/darwin" "-L" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/build/curl-sys-2c9ba7d4862c5909/out/build" "-L" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/build/libnghttp2-sys-b4d6a653383d59d5/out/i/lib" "-L" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/build/libgit2-sys-501fff0ebabe1cac/out/build" "-L" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB/release/build/libssh2-sys-abe7f7ce6f3d9fd3/out/build" "-L" "/opt/local/lib" "-L" "/Users/david/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/rustcEcBdGX/liblibgit2_sys-b602b1b169935df3.rlib" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/rustcEcBdGX/liblibssh2_sys-48ff383a0cab2867.rlib" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/rustcEcBdGX/libcurl_sys-9f992448e8dafaf8.rlib" "/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/rustcEcBdGX/liblibnghttp2_sys-a72e6424bf044ccd.rlib" "/Users/david/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-d11cefe128d6b458.rlib" "-framework" "CoreFoundation" "-liconv" "-framework" "Security" "-framework" "CoreFoundation" "-lssl" "-lcrypto" "-lclang_rt.osx" "-framework" "Security" "-framework" "CoreFoundation" "-lz" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: Undefined symbols for architecture arm64:
            "_iconv", referenced from:
                _git_path_iconv in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
               (maybe you meant: _git_path_iconv_init_precompose, _git_path_iconv_clear , _git_path_iconv )
            "_iconv_open", referenced from:
                _git_path_direach in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
                _git_path_iconv_init_precompose in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
                _git_path_diriter_init in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
            "_iconv_close", referenced from:
                _git_path_direach in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
                _git_path_iconv_clear in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
                _git_path_diriter_free in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
                _git_path_dirload in liblibgit2_sys-b602b1b169935df3.rlib(path.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: failed to compile `cargo-outdated v0.9.14`, intermediate artifacts can be found at `/var/folders/jr/q6_vllf57zd745fg100232y80000gn/T/cargo-installXrbgCB`

System information:

OS: macOS 11.3 Beta (20E5172i)
CLT version: Command Line Tools for Xcode 12.5 beta
Rust version: rustc 1.50.0 (cb75ad5db 2021-02-10)

Search terms: arm64, Apple Silicon

@valin4tor
Copy link
Author

valin4tor commented Feb 19, 2021

I think this is what's going on: rust-lang/rust#36250 (comment) (I also have libiconv installed via MacPorts)

Will look through that thread to see what solutions are available - it seems like this crate isn't responsible for the problem, seeing as I've now also encountered it when attempting to install the cargo-edit crate

@valin4tor
Copy link
Author

Aha, this is the root issue: rust-lang/git2-rs#263

Closing as this seems to be an upstream bug and I've now found a workaround, but feel free to reopen if required :)

@valin4tor valin4tor changed the title Fails to compile on aarch64-apple-darwin Fails to compile when libiconv is installed via MacPorts [upstream] Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants