sharkdp / bat

A cat(1) clone with wings.
Apache License 2.0
48.6k stars 1.23k forks source link

Bat library not loaded error #3032

Closed ciscohack closed 1 month ago

ciscohack commented 1 month ago

Hello expert,

I am getting errors with my BAT tool running on macOS 14.5. I am running the latest BAT 0.24 and bat completely un-usable

dyld[50896]: Library not loaded: /opt/homebrew/opt/libgit2@1.7/lib/libgit2.1.7.dylib Referenced from: <968B81E5-4BAB-323C-8FD5-1BFB54F3052D> /opt/homebrew/Cellar/bat/0.24.0_1/bin/bat Reason: tried: '/opt/homebrew/opt/libgit2@1.7/lib/libgit2.1.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libgit2@1.7/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/opt/libgit2@1.7/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file), '/opt/homebrew/Cellar/libgit2/1.8.1/lib/libgit2.1.7.dylib' (no such file)

image
ElemenTP commented 1 month ago

brew install libgit2@1.7 wiil fix this

the0xalex commented 1 month ago

Feels as though we could perhaps adjust the following dependency:

[[package]] name = "libgit2-sys" version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", "libz-sys", "pkg-config", ]

Either add it to package manager deps so it gets dl'd (brew, apt, whatever) or fix the fact that it's depending on an old version of the lib.

I encountered this issue when applying a security update to libgit. I'd make a PR but I've no idea how the core maintainers would prefer to address this.

ciscohack commented 1 month ago

thanks install lib solved the issue

vanstrouble commented 1 month ago

Is bat now going to use a precise version of that library (libgit2@1.7) or will they fix this over time?

ciscohack commented 1 month ago

libgit2@1.7

If we install libgit2@1.7 via brew then the bat is correctly recognized and used it... But I feel they should fix it by code level should be better option

eth-p commented 1 month ago

I'm going to close this in favour of #3029, which addresses the same problem.

Additionally, the Homebrew formula was updated on the 16th to point to the libgit2@1.7 instead of the latest version.

eth-p commented 1 month ago

Is bat now going to use a precise version of that library (libgit2@1.7) or will they fix this over time?

The dependency will be updated to use the newer libgit2, don't worry 🙂