Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bat fails to run due to dependency on older libgit2 version on macOS #3029

Open
applebait opened this issue Jul 17, 2024 · 8 comments
Open
Labels
bug Something isn't working macOS Issue is related to the macOS build of bat

Comments

@applebait
Copy link

Hello,

I am having an issue running bat on my macOS system. When I try to run bat, I get the following error message:

dyld[15323]: 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)

It appears that bat is trying to load libgit2.1.7.dylib, but I have libgit2 version 1.8.1 installed on my system. I tried reinstalling both bat and libgit2 using Homebrew, but the issue persists.
I am currently unable to uninstall libgit2 1.8.1 because other installed applications depend on it.
I would appreciate any guidance on how to resolve this issue. Please let me know if you need any additional information about my system or the steps I've taken.

Thanks.

@applebait applebait added the bug Something isn't working label Jul 17, 2024
@applebait
Copy link
Author

Ok, this is far from a bat issue. This is a libgit2 issue. I just installed libgit2@1.7 and it's all working again.

@suchcodemuchwow
Copy link

I'm having the same issue how did you download libgit2@1.7, did you install from source?

@adamreese
Copy link

I ran brew uninstall bat && brew install bat and the issue seemed to be resolved

@marcoreni
Copy link

I solved this with brew install libgit2@1.7.

@LanikSJ
Copy link

LanikSJ commented Jul 17, 2024

I ran brew uninstall bat && brew install bat and the issue seemed to be resolved

This was addressed upstream by Homebrew: Homebrew/homebrew-core#166767

@simon-aira
Copy link

Thanks to this thread, I resolved this be using brew uninstall bat && brew install bat. Out of curiousity – why did not brew upgrade bat help? I tried that first and it didn't help..

@eth-p eth-p added the macOS Issue is related to the macOS build of bat label Jul 31, 2024
@squatto
Copy link

squatto commented Aug 8, 2024

I'd recommend using brew reinstall bat instead of brew uninstall bat && brew install bat. Using reinstall ensures that the reinstall uses the original installation options.

From the help:

Usage: brew reinstall [options] formula|cask [...]

Uninstall and then reinstall a formula or cask using the same options it was
originally installed with, plus any appended options specific to a formula.

@mercxry
Copy link

mercxry commented Aug 26, 2024

I was having this issue today and I solved it by reinstalling libgit2@1.7 with: brew reinstall libgit2@1.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS Issue is related to the macOS build of bat
Projects
None yet
Development

No branches or pull requests

9 participants