Macchina-CLI / macchina

A system information frontend with an emphasis on performance.
https://crates.io/crates/macchina
MIT License
1.49k stars 52 forks source link

[BUG] Will not install Cannot open shared object file libgit2.so.1.3 #179

Closed jhessin closed 3 years ago

jhessin commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

I cannot install macchina. I get the following error when trying to run cargo install macchina:

error: failed to run custom build command for `macchina v4.0.1`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installBthpVF/release/build/macchina-21c3af39396ae85f/build-scri
pt-build` (exit status: 127)
  --- stderr
  /tmp/cargo-installBthpVF/release/build/macchina-21c3af39396ae85f/build-script-build: error while loading share
d libraries: libgit2.so.1.3: cannot open shared object file: No such file or directory
warning: build failed, waiting for other jobs to finish...
error: failed to compile `macchina v4.0.1`, intermediate artifacts can be found at `/tmp/cargo-installBthpVF`

To Reproduce Steps to reproduce the behavior:

  1. Run cargo install macchina on Pop OS
  2. Get the same error as stated.

Expected behavior A clear and concise description of what you expected to happen.

The program should install.

Screenshots If applicable, add screenshots to help explain your problem.

macchina --doctor output Add a screenshot or copy and paste the output of --doctor if an element you're supposed to be seeing isn't showing up.

System Information You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

grtcdr commented 3 years ago

We might've overlooked git as a requirement to build the project. During the build process we collect the hash of the git commit from which macchina was built, and display it for you when you run macchina --version, for example:

2021-10-25T23:27:41,854222673+01:00

Install git and you should be able to build and run macchina. I'll make sure to add the requirement to the README to prevent this issue from occuring in the future.

jhessin commented 3 years ago

That's silly - who here doesn't have git. I have had git that isn't the issue. I even installed librust-libgit2-sys-dev/focal,now 0.7.11-1 amd64 [installed]. Still get the same error.

grtcdr commented 3 years ago

That's silly - who here doesn't have git.

libgit2.so.1.3: cannot open shared object file: No such file or directory - this makes me think git is not installed...

EDIT: turns out git doesn't actually package libgitso, I'll try and find the module that's responsible for this library.

EDIT 2: Looks like you need to install libgit2 which should fix this. This is a required dependency for some Rust programs, like exa and delta. I'm glad you reported the issue :)

jhessin commented 3 years ago

libgit2-dev is already the newest version (0.28.4+dfsg.1-2). Is that the package I want? I already had it.

jhessin commented 3 years ago

Hmm... So I was able to install with linuxbrew, but I still can't install with cargo. Not sure what's different in the install procedures but you would think cargo would be able to install a rust crate easier than a ruby library would.

grtcdr commented 3 years ago

Hmm... So I was able to install with linuxbrew, but I still can't install with cargo. Not sure what's different in the install procedures but you would think cargo would be able to install a rust crate easier than a ruby library would.

Glad it worked, but it's generally really easy to install things through cargo, weird things happen sometimes.

Is that the package I want? I already had it.

Does libgit2-dev provide /usr/lib/libgit2.so?

jhessin commented 3 years ago

No it doesn't, the only place I can locate that is in my linuxbrew directory - probably insntalled as a dependency somewhere along the line. Do you know any package I could install with apt that would have that?

grtcdr commented 3 years ago

Screenshot_20211026_133119.jpg

Looks like it's there for the listed versions. (does Pop!_OS use Ubuntu's repos?)

jhessin commented 3 years ago

I see the problem - it does use ubuntu repos, but I'm using the LTS version for stability (20.04). I don't think it has it. I was able to install after downloading this and running this in the cmake directory:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr
sudo cmake --build . --target install

For anyone having this issue with other projects.

grtcdr commented 3 years ago

I see the problem - it does use ubuntu repos, but I'm using the LTS version for stability (20.04). I don't think it has it. I was able to install after downloading this and running this in the cmake directory:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr
sudo cmake --build . --target install

For anyone having this issue with other projects.

Thanks for sharing the solution, do you mind if I reference it in the README?

jhessin commented 3 years ago

Sure. No problem at all.

On Tue, Oct 26, 2021 at 7:52 AM Aziz Ben Ali @.***> wrote:

I see the problem - it does use ubuntu repos, but I'm using the LTS version for stability (20.04). I don't think it has it. I was able to install after downloading this https://github.com/libgit2/libgit2/releases and running this in the cmake directory:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr sudo cmake --build . --target install

For anyone having this issue with other projects.

Thanks for sharing the solution, do you mind if I reference it in the README?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/Macchina-CLI/macchina/issues/179#issuecomment-951962854, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPTZORV7QMOPSHS6V5WDILUI2XDDANCNFSM5GWKQFBQ .

--

  • Jim