rust-lang / git2-rs

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

Update the depencies to link to libgit2 > 1.4.x #879

Closed ondrej-ivanko closed 1 year ago

ondrej-ivanko commented 2 years ago

Hi,

I recently update my os and new C libgit2 library version was released and packaged for my distro. Can you please update this dependency of yours. Some of my binaries stopped working with newer libgit2 version like ripgrep, bat, gitui - all depending on this rust implementation of libgit2.

Thank you.

ehuss commented 1 year ago

Sorry, I don't fully understand the issue you are having. The most recent git2 Rust package supports libgit2 1.4.4 up to (and including) 1.5.0. When building libgit2-sys with the vendored feature, it will use the bundled version of libgit2 which I believe is 1.5.0.

Can you provide more information on exactly what packages you are trying to build, what the errors are, or more details about what steps you are taking?

ondrej-ivanko commented 1 year ago

Hi @ehuss,

the problem I have is when I update libgit library in my linux os from libgit2-1:1.4.4-1 -> 1.5.0-1, I suddenly can't run some applications like rg, bat, gitui, which have crate dependencies in git2, libgit2-sys. Updated exa application can run with my os libigit2. So I'm not sure I really undestand the problem here.

When I run applications the depend on libgit2, I get this error: gitui: error while loading shared libraries: libgit2.so.1.4: cannot open shared object file: No such file or directory this is after libgit2 update to 1.5.0, so evidently those applications are expecting the version of libgit2 that's not there anymore.

kim commented 1 year ago

@ondrej-ivanko You are probably building those applications from source (using cargo), and not installing them via your distro's package manager. At link time, they choose whatever libgit2 is present on the system. When you update libgit2 using the package manager, what was linked to is gone, so the applications don't work anymore.

So, either you need to get those applications from the package manager as well, or make sure they use a "vendored" copy of libgit2 (via git2's vendored-libgit2 feature).

ondrej-ivanko commented 1 year ago

Hi @kim,

you are right. I installed those apps via cargo, so I uninstalled and than installed them again. And now they're linked to my newer libgit2 version. I tried to reinstall them before (with just cargo install), without uninstalling them first. I expect that would recompile them, so they would be linked to newer libgit2 version, but to no avail. Anyway it works now. Thank you for help. Cheers.