orbit icon indicating copy to clipboard operation
orbit copied to clipboard

`cargo install --git ...` fails to find `clif` dependency, but building from source works fine.

Open benjamin051000 opened this issue 1 year ago • 3 comments

Describe the bug Running cargo install --git https://github.com/cdotrus/orbit.git --tag 0.12.0 fails. However, cloning the repo and running cargo build seems to resolve the dependency just fine, and the executable works.

To Reproduce Steps to reproduce the behavior:

  1. Run cargo install --git https://github.com/cdotrus/orbit.git (optionally with --tag 0.12.0)
  2. See error
  3. Clone the repo and run cargo build
  4. See a successful build

Expected behavior cargo install should resolve the dependency.

Screenshots

❯ cargo install --git https://github.com/cdotrus/orbit.git --tag 0.12.0 
    Updating git repository `https://github.com/cdotrus/orbit.git`
  Installing orbit v0.12.0 (https://github.com/cdotrus/orbit.git?tag=0.12.0#7c410599)
    Updating git repository `https://github.com/cdotrus/clif`
error: failed to compile `orbit v0.12.0 (https://github.com/cdotrus/orbit.git?tag=0.12.0#7c410599)`, intermediate artifacts can be found at `/tmp/cargo-installMEZpsS`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  failed to get `clif` as a dependency of package `orbit v0.12.0 (/home/benjamin/.cargo/git/checkouts/orbit-f051ae44dadefe9d/7c41059)`

Caused by:
  failed to load source for dependency `clif`

Caused by:
  Unable to update https://github.com/cdotrus/clif?tag=0.1.5

Caused by:
  failed to find tag `0.1.5`

Caused by:
  reference 'refs/remotes/origin/tags/0.1.5' not found; class=Reference (4); code=NotFound (-3)

Desktop (please complete the following information):

❯ lsb_release --all
LSB Version:	n/a
Distributor ID:	openSUSE
Description:	openSUSE Tumbleweed
Release:	20240520
Codename:	n/a

❯ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/benjamin/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.78.0 (9b00956e5 2024-04-29)

Additional context The URL in Cargo.toml, https://github.com/cdotrus/clif, redirects to https://github.com/cdotrus/cliproc. Perhaps updating it will fix the problem?

I'm also wondering if this is an upstream issue with cargo.

benjamin051000 avatar May 23 '24 18:05 benjamin051000

Looks like by running:

❯ cargo remove clif
❯ cargo add --git https://github.com/cdotrus/cliproc

I'm able to pass this error. Of course, now I get lots of compile fails since clif no longer exists as a source code symbol.

benjamin051000 avatar May 23 '24 18:05 benjamin051000

Hey Ben! Thanks for opening an issue. I am currently overhauling the cli library (originally clif, now called cliproc) and adding it to crates.io. With this overhaul, there is a lot of breaking changes that I hope to fix up soon.

If you need a binary asap, there should be some available under the "Releases" tab for version 0.12.0. Hopefully it has one that suits your computer's specs.

chaseruskin avatar May 23 '24 23:05 chaseruskin

No worries, I was (somehow) able to build it myself... Although I'm not sure how. I guess the tag pulled for clif (0.1.5) doesn't have any breaking changes, so it compiles just fine? Still, it's odd that it appears to compile and run one way, but can't the other way.

benjamin051000 avatar May 24 '24 00:05 benjamin051000

The latest release (0.13.0) now has the correct dependencies listed in the Cargo.toml file with all deprecated packages (clif) fixed.

chaseruskin avatar Jun 14 '24 09:06 chaseruskin