[MacPorts] #71884: bat declares unnecessary dependency on libgit2 because it uses vendored copy
MacPorts
noreply at macports.org
Mon Jan 20 09:52:44 UTC 2025
#71884: bat declares unnecessary dependency on libgit2 because it uses vendored
copy
------------------------+--------------------
Reporter: neverpanic | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port: bat
------------------------+--------------------
bat does not actually use the system libgit2, because it is too old. The
libgit2-sys crate's build.rs file at
work/.home/.cargo/macports/libgit2-sys-0.17.0+1.8.1/build.rs contains:
{{{
/// Tries to use system libgit2 and emits necessary build script
instructions.
fn try_system_libgit2() -> Result<pkg_config::Library, pkg_config::Error>
{
let mut cfg = pkg_config::Config::new();
match cfg.range_version("1.8.1".."1.9.0").probe("libgit2") {
Ok(lib) => {
for include in &lib.include_paths {
println!("cargo:root={}", include.display());
}
Ok(lib)
}
Err(e) => {
println!("cargo:warning=failed to probe system libgit2: {e}");
Err(e)
}
}
}
}}}
The corresponding pkg-config invocation is
{{{
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-
config" "--libs" "--cflags" "libgit2" "libgit2 >= 1.8.1" "libgit2 < 1.9.0"
}}}
which returns nothing, because libgit2 in MacPorts is at 1.7.2.
As a consequence, bat builds with the vendored copy of libgit2-sys
instead.
Please either update libgit2 to a version compatible with bat, or always
switch to the vendored copy and remove the libgit2 library dependency.
--
Ticket URL: <https://trac.macports.org/ticket/71884>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list