rust-lang / git2-rs

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

Cannot build git2-rs in macOS Monterey 12.5.1 #874

Open Moskize91 opened 2 years ago

Moskize91 commented 2 years ago

I execute this commands but got a fail message.

git clone https://github.com/rust-lang/git2-rs
cd git2-rs
cargo build

then I read the README.md - Building on macOS 10.10+ and execute this commands.

brew install openssl@1.1
brew list openssl@1.1

and I got this

/usr/local/Cellar/openssl@1.1/1.1.1q/.bottle/etc/ (7 files)
/usr/local/Cellar/openssl@1.1/1.1.1q/bin/c_rehash
/usr/local/Cellar/openssl@1.1/1.1.1q/bin/openssl
/usr/local/Cellar/openssl@1.1/1.1.1q/include/openssl/ (104 files)
/usr/local/Cellar/openssl@1.1/1.1.1q/lib/libcrypto.1.1.dylib
/usr/local/Cellar/openssl@1.1/1.1.1q/lib/libssl.1.1.dylib
/usr/local/Cellar/openssl@1.1/1.1.1q/lib/engines-1.1/ (2 files)
/usr/local/Cellar/openssl@1.1/1.1.1q/lib/pkgconfig/ (3 files)
/usr/local/Cellar/openssl@1.1/1.1.1q/lib/ (4 other files)
/usr/local/Cellar/openssl@1.1/1.1.1q/share/doc/ (3983 files)
/usr/local/Cellar/openssl@1.1/1.1.1q/share/man/ (3983 files)

then I run ...

cargo clean
export OPENSSL_INCLUDE_DIR="/usr/local/Cellar/openssl@1.1/1.1.1q/include" 
export OPENSSL_LIB_DIR="/usr/local/Cellar/openssl@1.1/1.1.1q/lib"
cargo build

but I got the fail message again:

error_message.log

finally, I can't build git2-rs. and i want to know how can I built it in macOS?