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

Can't install ripgrep_all with cargo from crates #67

Closed
halostatue opened this issue Jul 6, 2020 · 12 comments
Closed

Can't install ripgrep_all with cargo from crates #67

halostatue opened this issue Jul 6, 2020 · 12 comments

Comments

@halostatue
Copy link

I tried to update ripgrep_all, but it failed on what appears to be a dependency issue. If this has been resolved on master, it’s probably worth cutting a new version to crates.io that fixes this.

$ cargo install ripgrep_all
    Updating crates.io index
  Installing ripgrep_all v0.9.6
error: failed to compile `ripgrep_all v0.9.6`, intermediate artifacts can be found at `/var/folders/6t/2xp3hp2j1vd5yyklq0b6_lbw0000gn/T/cargo-install3jDwt5`

Caused by:
  failed to select a version for the requirement `cachedir = "^0.1.1"`
  candidate versions found which didn't match: 0.2.0
  location searched: crates.io index
required by package `ripgrep_all v0.9.6`

$ rustc --version
rustc 1.44.1 (c7087fe00 2020-06-17)
$ cargo --version
cargo 1.44.1 (88ba85757 2020-06-11)
@ramifications123
Copy link

ramifications123 commented Aug 4, 2020

Agree, has anyone found a fix for it?
Same problem, version 1.45.2

@rickhg12hs
Copy link

I was having trouble installing ripgrep_all too. This seemed to work for me, though there were several compiler warnings.

cargo +nightly install --git https://github.com/phiresky/ripgrep-all.git

@tan-wei
Copy link

tan-wei commented Sep 6, 2020

Same issue with nightly.

@wonderfulspam
Copy link

For anyone wondering, this is caused by cachedir v0.1.1 being yanked from crates.io. The dependency was removed in this commit which also marked the switch to depending on the nightly compiler. Some of the compiler warnings seem to be caused by the master branch being in a transitional state (eg. unused imports) while another is due to the usage of an unstable nightly feature.

At the time of writing, the master branch depends on two nightly-only features, at least one of which (specialization) is probably a ways off of stabilizing, so it could be a while before this crate can be installed using the stable toolchain. Provided the project continues to rely on those features, of course.

TL;DR: Installing from crates.io will not work until a new version is published. Installing via git using the nightly compiler is the only option for now.

Bonus info: it seems like Cargo's error message will soon be more explicit when you try to install a crate that depends on a yanked crate.

@blueray453
Copy link

If you use cargo +nightly install --git https://github.com/phiresky/ripgrep-all.git then you are basically using master branch which can create some problem. For example you can not use pandoc adapter. #111 (comment)

@blueray453
Copy link

I did some research. https://doc.rust-lang.org/cargo/commands/cargo-install.html#description says that

By default, the Cargo.lock file that is included with the package will be ignored. This means that Cargo will recompute which versions of dependencies to use, possibly using newer versions that have been released since the package was published. The --locked flag can be used to force Cargo to use the packaged Cargo.lock file if it is available. This may be useful for ensuring reproducible builds, to use the exact same set of dependencies that were available when the package was published. It may also be useful if a newer version of a dependency is published that no longer builds on your system, or has other problems. The downside to using --locked is that you will not receive any fixes or updates to any dependency. Note that Cargo did not start publishing Cargo.lock files until version 1.37, which means packages published with prior versions will not have a Cargo.lock file available.

And also https://stackoverflow.com/questions/68509895/what-does-package-foo-in-cargo-lock-is-yanked-in-registry-mean . So, the conclusion for the time being seems to be using:

cargo install --locked ripgrep_all

@SwenChan
Copy link

SwenChan commented Oct 26, 2021

@blueray453 thx, I meet the same problem and use cargo install --locked ripgrep_all to install it and success.

@Volker-Weissmann
Copy link

@blueray453 thx, I meet the same problem and use cargo install --locked ripgrep_all to install it and success.

Same here

@donutbrew
Copy link

None of the options here seem to work for me.

Using the nightly build (or master from git) I get a bunch of compilation errors--things like mismatched types.

using --locked

$ cargo install --locked ripgrep_all
    Updating crates.io index
warning: no Cargo.lock file published in ripgrep_all v0.9.6
  Installing ripgrep_all v0.9.6
error: failed to compile `ripgrep_all v0.9.6`, intermediate artifacts can be found at `/tmp/cargo-installKe4sL6`

Caused by:
  failed to select a version for the requirement `cachedir = "^0.1.1"`
  candidate versions found which didn't match: 0.3.0, 0.2.0
  location searched: crates.io index
  required by package `ripgrep_all v0.9.6`

using +nightly:

$ cargo +nightly install --locked ripgrep_all
    Updating crates.io index
warning: no Cargo.lock file published in ripgrep_all v0.9.6
  Installing ripgrep_all v0.9.6
error: failed to compile `ripgrep_all v0.9.6`, intermediate artifacts can be found at `/tmp/cargo-installU0KjlM`

Caused by:
  failed to select a version for the requirement `cachedir = "^0.1.1"`
  candidate versions found which didn't match: 0.3.0, 0.2.0
  location searched: crates.io index
  required by package `ripgrep_all v0.9.6`

@danberindei
Copy link

Unfortunately the latest commit has a compilation error, but I was able to install from the Oct 26 commit that upgraded the dependencies:

cargo install --git https://github.com/phiresky/ripgrep-all.git --rev 94f06fba37c309d21f3bede7719de660290b7802

@phiresky
Copy link
Owner

phiresky commented Nov 11, 2022

Master does not contain a working version regardless of if it compiles or not while I'm migrating the code base to async (most of the code is disabled). The last working version is 0.9.6. Install via the released binary or using cargo install --locked ripgrep_all

@danberindei
Copy link

danberindei commented Nov 11, 2022

@phiresky thanks, I wanted to install a newer version because of #113, but I understand why you wouldn't want people to use code you don't consider ready and then wonder why it's not working as it should.

I checked and cargo install --locked ripgrep_all worked fine (except for the pipe error with -l, of course).

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

No branches or pull requests