sharkdp / bat

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

Bat library not loaded error #3032

Closed ciscohack closed 3 months ago

ciscohack commented 4 months 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 4 months ago

brew install libgit2@1.7 wiil fix this

the0xalex commented 4 months 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 4 months ago

thanks install lib solved the issue

vanstrouble commented 4 months 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 3 months 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 3 months 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 3 months 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 🙂

aragalie commented 2 weeks ago

In case anyone lands here through Google, the solution is this: https://github.com/sharkdp/bat/issues/3029#issuecomment-2234140805

brew uninstall bat && brew install bat