Skip to content

Commit

Permalink
Respect libgit2's ABI instability
Browse files Browse the repository at this point in the history
libgit2 does not have a stable ABI across minor versions, as has been
demonstrated in the last few minor releases, see #813 and #746. This
pain is primarily suffered by users of rolling release distros, because
they tend to get a new libgit2 version before the authors of libraries
release versions that pull in the new libgit2-sys version which works
with the new binary.

This patch means that going forward, users don't need to rush to
upgrade their version of libgit2-sys or suffer errors/UB in the
meantime. If the system version changes, they will just start using
the vendored version which has been tested against the bindings.
  • Loading branch information
saethlin authored and joshtriplett committed Mar 18, 2022
1 parent b9cbb44 commit 86721d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() {
let try_to_use_system_libgit2 = !vendored && !zlib_ng_compat;
if try_to_use_system_libgit2 {
let mut cfg = pkg_config::Config::new();
if let Ok(lib) = cfg.atleast_version("1.4.0").probe("libgit2") {
if let Ok(lib) = cfg.range_version("1.4.0".."1.5.0").probe("libgit2") {
for include in &lib.include_paths {
println!("cargo:root={}", include.display());
}
Expand Down

0 comments on commit 86721d1

Please sign in to comment.