Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(macos): don't use
ssh
feature for git2
dependency
Using the `ssh` feature induces a dependency on `openssl`. On my Macbook, this produced the following linking error: ``` = note: Undefined symbols for architecture x86_64: "_OPENSSL_init_ssl", referenced from: std::sync::once::Once::call_once::_$u7b$$u7b$closure$u7d$$u7d$::he73245cadb6fb5f7 (.llvm.1763620816825828942) in libopenssl_sys-e129a1c9f9682ba1.rlib(openssl_sys-e129a1c9f9682ba1.openssl_sys.dn7psuzk-cgu.6.rcgu.o) core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h2d3710fadd6753f9 (.llvm.1763620816825828942) in libopenssl_sys-e129a1c9f9682ba1.rlib(openssl_sys-e129a1c9f9682ba1.openssl_sys.dn7psuzk-cgu.6.rcgu.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` I tried the following: * Running `brew install openssl@1.1` as per the instructions at https://docs.rs/openssl/0.10.33/openssl/ * Setting the environment variables mentioned in `brew info openssl` * Setting `LIBGIT2_SYS_USE_PKG_CONFIG=1` as mentioned in rust-lang/git2-rs#229 None of these worked. So I'm disabling the `ssh` feature for now. If `git-branchless` needs the `ssh` feature in the future (for example, if we add a Github integration and want it to pull/push directly), then we'll have to resolve the issue properly. It's possible my particular issue is due to running Homebrew on a too-old version of macOS, and that it might be resolved by an OS upgrade and re-installing my Homebrew packages.
- Loading branch information
43c1f64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Fix is normally just setting following during build:
export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl@1.1/lib/pkgconfig"
(afterbrew install openssl@1.1
)Why am I adding this as a comment? Found I found this while googling for issue I was facing with
git2
with ssh support. Hopefully saves some others some pain ;-) <343c1f64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also be aware that there may be ABI differences between the version expected by your software and the actual version you installed. See rust-lang/git2-rs#721 for an example of a difference between libgit2 1.0 and 1.1.