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

libgit2 not loaded, fixed with reinstall #224

Closed
RileyLeff opened this issue Mar 13, 2023 · 4 comments
Closed

libgit2 not loaded, fixed with reinstall #224

RileyLeff opened this issue Mar 13, 2023 · 4 comments

Comments

@RileyLeff
Copy link

RileyLeff commented Mar 13, 2023

I'm running MacOS 13.2.1 on a M1 Pro. I updated libgit2 via homebrew this morning and that seems to have broken cargo-update. I was getting this message any time I tried to run it:

rileyleff@redwood % `cargo install-update -a`
dyld[54025]: Library not loaded: /opt/homebrew/opt/libgit2/lib/libgit2.1.5.dylib
  Referenced from: <12F83569-42EC-3C9F-8799-C0CC973938AC> /Users/rileyleff/.cargo/bin/cargo-install-update
  Reason: tried: '/opt/homebrew/opt/libgit2/lib/libgit2.1.5.dylib' (no such file),
  '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libgit2/lib/libgit2.1.5.dylib' (no such file),
  '/opt/homebrew/opt/libgit2/lib/libgit2.1.5.dylib' (no such file),
  '/Users/rileyleff/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/libgit2.1.5.dylib' (no such file),
  '/Users/rileyleff/lib/libgit2.1.5.dylib' (no such file),
  '/usr/local/lib/libgit2.1.5.dylib' (no such file),
  '/usr/lib/libgit2.1.5.dylib' (no such file, not in dyld cache),
  '/opt/homebrew/Cellar/libgit2/1.6.2/lib/libgit2.1.5.dylib' (no such file),
  '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libgit2/1.6.2/lib/libgit2.1.5.dylib' (no such file),
  '/opt/homebrew/Cellar/libgit2/1.6.2/lib/libgit2.1.5.dylib' (no such file),
  '/Users/rileyleff/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/libgit2.1.5.dylib' (no such file),
  '/Users/rileyleff/lib/libgit2.1.5.dylib' (no such file),
  '/usr/local/lib/libgit2.1.5.dylib' (no such file),
  '/usr/lib/libgit2.1.5.dylib' (no such file, not in dyld cache)
zsh: abort      cargo install-update --help

After reinstalling cargo-update with cargo install cargo-update --force it's back to working as expected.

Just wanted to have this on here in case anyone else runs into a similar issue, or if this error message indicates the need for a minor fix, etc. Appreciate everyone's work on this tool!

@Guara92
Copy link

Guara92 commented Apr 1, 2023

Same on Asahi Linux after last git update

@eduarddejong
Copy link

eduarddejong commented Apr 2, 2023

Same issue here, on Arch Linux (with package rustup installed from the distro using pacman, everything else via rustup and cargo), but with a slightly different way the error was written and also without that stack trace:

/home/eduard/.cargo/bin/cargo-install-update: error while loading shared libraries: libgit2.so.1.5: cannot open shared object file: No such file or directory

Nevertheless, a cargo uninstall cargo-update, followed by a cargo install cargo-update fixed it for me as well, triggering a recompile of a lot of packages.

If it's something I can prevent as a user of this package, it would be great to know about it for learning experience.

@nabijaczleweli
Copy link
Owner

Ultimately the answer to "i changed my system libraries" is "rebuild their dependents".

If you want to embed fixed versions of some libraries you also have on your system you can do cargo install-update-config -f vendored-openssl -f vendored-libgit2 -f vendored-libcurl cargo-update.

@alban-semana
Copy link

alban-semana commented Apr 5, 2023

@eduarddejong libgit2 version has switch, you just need to compile cargo-update :

cargo install -f cargo-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants