Closed lampewebdev closed 1 year ago
Hm, I haven't seen any issues like that. Can you provide a complete reproduction, preferably without using external commands like cargo debug
?
That is, something like:
cargo build --example fetch
lldb target/debug/examples/fetch
run
Also, can you provide the output of cargo -Vv
, and also otool -L path/to/your/binary
to see which OpenSSL it is linking? I think the likely cause is that there is some installation of OpenSSL on your system that it is not working with.
So I followed your repo and got the following:
cargo -Vv
cargo 1.71.0-nightly (ac8401032 2023-05-02)
release: 1.71.0-nightly
commit-hash: ac84010322a31f4a581dafe26258aa4ac8dea9cd
commit-date: 2023-05-02
host: aarch64-apple-darwin
libgit2: 1.6.3 (sys:0.17.0 vendored)
libcurl: 7.87.0 (sys:0.4.61+curl-8.0.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1t 7 Feb 2023
os: Mac OS 13.3.1 [64-bit]
otool -L target/debug/examples/fetch
target/debug/examples/fetch:
/opt/homebrew/opt/libgit2/lib/libgit2.1.6.dylib (compatibility version 1.6.0, current version 1.6.4)
/opt/homebrew/opt/openssl@3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/opt/homebrew/opt/openssl@3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
Thanks, I'm able to reproduce it now. Looks like it works with OpenSSL 1.1.1, but has an issue with 3.1.
One workaround is to use the vendored-openssl
feature, which won't use your system OpenSSL.
It looks like this is https://github.com/openssl/openssl/issues/20753. I'm not sure, but it looks like the fix for that has already been merged, but did not make it into the 3.1 release.
Considering this is likely an OpenSSL issue, I'm going to close as I think it is out of our control. I suspect this will be fixed in a future release of OpenSSL.
Hello,
When trying to debug with lldb on MacOS I this error:![image](https://github.com/rust-lang/git2-rs/assets/44268468/6f56fd51-b0bd-48ac-a418-1f4d795eb145)
a workaround is disable the default features for now: