Skip to content

Commit 86721d1

Browse files
saethlinjoshtriplett
authored andcommitted
Respect libgit2's ABI instability
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.
1 parent b9cbb44 commit 86721d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libgit2-sys/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
let try_to_use_system_libgit2 = !vendored && !zlib_ng_compat;
1515
if try_to_use_system_libgit2 {
1616
let mut cfg = pkg_config::Config::new();
17-
if let Ok(lib) = cfg.atleast_version("1.4.0").probe("libgit2") {
17+
if let Ok(lib) = cfg.range_version("1.4.0".."1.5.0").probe("libgit2") {
1818
for include in &lib.include_paths {
1919
println!("cargo:root={}", include.display());
2020
}

0 commit comments

Comments
 (0)