rossmacarthur / sheldon

:bowtie: Fast, configurable, shell plugin manager
https://sheldon.cli.rs
Apache License 2.0
1.02k stars 21 forks source link

Building against libgit2 1.2.0 results in failing tests #124

Closed donbex closed 2 years ago

donbex commented 2 years ago

The libgit2 in the Arch repositories has been upgraded to version 1.2.0, so after a system update I encountered the error

sheldon: error while loading shared libraries: libgit2.so.1.1: cannot open shared object file: No such file or directory

I tried re-building sheldon from source using the AUR package, but it resulted in a bunch of test failures:

failures:

---- lock::tests::external_plugin_lock_git_with_uses stdout ----
thread 'lock::tests::external_plugin_lock_git_with_uses' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1181:62

---- lock::tests::external_plugin_lock_git_with_matches_error stdout ----
thread 'lock::tests::external_plugin_lock_git_with_matches_error' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1255:62
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- lock::tests::external_plugin_lock_git_with_matches_not_each stdout ----
thread 'lock::tests::external_plugin_lock_git_with_matches_not_each' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1283:62

---- lock::tests::external_plugin_lock_git_with_matches stdout ----
thread 'lock::tests::external_plugin_lock_git_with_matches' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1221:62

---- lock::tests::source_lock_git_git_with_checkout stdout ----
thread 'lock::tests::source_lock_git_git_with_checkout' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `git://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1068:10

---- lock::tests::source_lock_git_and_reinstall stdout ----
thread 'lock::tests::source_lock_git_and_reinstall' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1009:89

---- lock::tests::locked_config_clean stdout ----
thread 'lock::tests::locked_config_clean' panicked at 'assertion failed: ctx.clone_dir().join(\"github.com/rossmacarthur/sheldon-test\").exists()', src/lock.rs:1397:9

---- lock::tests::source_lock_git_https_with_checkout stdout ----
thread 'lock::tests::source_lock_git_https_with_checkout' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1045:10

---- lock::tests::source_lock_with_git stdout ----
thread 'lock::tests::source_lock_with_git' panicked at 'called `Result::unwrap()` on an `Err` value: failed to git clone `https://github.com/rossmacarthur/sheldon-test`

Caused by:
    invalid version 0 on git_proxy_options; class=Invalid (3)', src/lock.rs:1135:40

failures:
    lock::tests::external_plugin_lock_git_with_matches
    lock::tests::external_plugin_lock_git_with_matches_error
    lock::tests::external_plugin_lock_git_with_matches_not_each
    lock::tests::external_plugin_lock_git_with_uses
    lock::tests::locked_config_clean
    lock::tests::source_lock_git_and_reinstall
    lock::tests::source_lock_git_git_with_checkout
    lock::tests::source_lock_git_https_with_checkout
    lock::tests::source_lock_with_git

I tried looking into it, but unfortunately I am not really familiar with Rust and couldn't locate the source of the error.

rossmacarthur commented 2 years ago

Thanks for the report, I am able to replicate. Sheldon depends on the Rust libgit2-sys package and the latest release of Sheldon depends on an older version of that package that doesn't seem to support libgit2 version >=1.2.0, this issue exists up stream. I might have to release a newer version of Sheldon that updates these dependencies to fully resolve this. Additionally, I don't maintain the AUR package so I'm not sure how quickly it will be updated.

In the meantime you can try download the MUSL release from the releases page It was compiled to statically link to libgit2 and other dependencies so should just work out of the box. The following script can do it for you automatically.

  curl --proto '=https' --tlsv1.2 -sSf https://rossmacarthur.github.io/install/crate.sh \
    | bash -s -- --repo rossmacarthur/sheldon --to /usr/bin