rossmacarthur / sheldon

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

[Install Fails] Difference of clap version between git repo and cargo repo #123

Closed bastienbc closed 2 years ago

bastienbc commented 2 years ago

Hi,

I'm relatively new to rust so I've done what I could to track down what I think is the source of my issue. When I use cargo install sheldon on my fedora 34, I have this message:

error: `#[clap(default_value)` attribute (without a value) has been replaced by `#[clap(default_value_t)]`.

  = help: Change the attribute to `#[clap(default_value_t)]`

   --> /home/wedge/.cargo/registry/src/github.com-1ecc6299db9ec823/sheldon-0.6.4/src/cli.rs:168:39
    |
168 |     #[clap(long, value_name = "WHEN", default_value)]
    |                                       ^^^^^^^^^^^^^

error: failed to compile `sheldon v0.6.4`, intermediate artifacts can be found at `/tmp/cargo-installLoOQHW`

Caused by:
  could not compile `sheldon` due to previous error

But I have cloned the 0.6.4 branch and cargo build --release is fine.

What I have found is that cargo install use clap version v3.0.0-beta.4, and the repo Cargo.toml use v3.0.0-beta.2. If I do cargo update -p clap --precise 3.0.0-beta.4 I have the exact same error.

rossmacarthur commented 2 years ago

@bastienbc Please try cargo install --locked sheldon to force it to use the lock file included. Cargo doesn't respect the lock file in cargo install unless you include this flag.

See https://github.com/rust-lang/cargo/issues/7169

bastienbc commented 2 years ago

Ok It works fine. Thanks for the advise. Also great job you're doing. Your project replaced my zplug config which was slow and buggy.

rossmacarthur commented 2 years ago

I have made sure to pin clap in the latest version of sheldon so the --locked flag shouldn't be required anymore. They seem to making a lot of breaking changes between each beta version.