rust-lang / git2-rs

libgit2 bindings for Rust
https://docs.rs/git2
Apache License 2.0
1.65k stars 381 forks source link

Unable to compile libgit2 into MacOS aarch64 #934

Closed zoedsoupe closed 1 year ago

zoedsoupe commented 1 year ago

Here's the partial log:

The following warnings were emitted during compilation:

warning: libgit2/src/libgit2/streams/stransport.c:13:10: fatal error: 'Security/SecureTransport.h' file not found
warning: #include <Security/SecureTransport.h>
warning:          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `libgit2-sys v0.14.2+1.5.1`

Caused by:
  process didn't exit successfully: `/Users/zoey.pessanha/dev/pescarte/cli/target/debug/build/libgit2-sys-793c053f263191ef/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBGIT2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_apple_darwin
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBGIT2_STATIC
  cargo:rerun-if-env-changed=LIBGIT2_DYNAMIC

# ...

error occurred: Command "clang" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer" "--target=arm64-apple-darwin" "-I" "/Users/zoey.pessanha/dev/pescarte/cli/target/debug/build/libgit2-sys-ebeafe6f7b31e843/out/include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/http-parser""-I" "libgit2/deps/pcre" "-I" "/Users/zoey.pessanha/dev/pescarte/cli/target/debug/build/libssh2-sys-8def8fe1fed40980/out/include" "-I" "/Users/zoey.pessanha/dev/pescarte/cli/target/debug/build/libz-sys-03f3936e3b60c1ab/out/include" "-fvisibility=hidden" "-DGIT_REGEX_BUILTIN=1" "-DHAVE_STDINT_H=1" "-DHAVE_MEMMOVE=1" "-DNO_RECURSE=1" "-DNEWLINE=10" "-DPOSIX_MALLOC_THRESHOLD=10" "-DLINK_SIZE=2" "-DPARENS_NEST_LIMIT=250" "-DMATCH_LIMIT=10000000" "-DMATCH_LIMIT_RECURSION=MATCH_LIMIT" "-DMAX_NAME_SIZE=32" "-DMAX_NAME_COUNT=10000" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\"" "-o" "/Users/zoey.pessanha/dev/pescarte/cli/target/debug/build/libgit2-sys-ebeafe6f7b31e843/out/build/libgit2/src/libgit2/streams/stransport.o" "-c" "libgit2/src/libgit2/streams/stransport.c" with args "clang" did not execute successfully (status code exit status: 1).

Here's the complete log (too long): log.txt

ehuss commented 1 year ago

This looks like a duplicate of #768, so closing in favor of that. I haven't had any issues with building on aarch64, so this will need some investigation to reproduce it. Are you using something like nixshell like the other user? Which version of macOS do you have? Which version of xcode are you using? Those kinds of details should be included in the other issue, and any other non-standard settings or things installed.