nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Doesn't update using original `--features` flag #126

Closed Amanita-muscaria closed 4 years ago

Amanita-muscaria commented 4 years ago

I've been working on nushell of late and they just release 0.9.0 so I went to update it using cargo install-update -a -g (I'm installing it from the repo so I can find bugs to fix) but instead of installing with --features=stable it seems to have used no feature flags at all. Is there a settings I don't know about or is this just not implemented yet?

nabijaczleweli commented 4 years ago

Unfortunately cargo install doesn't save the feature flags anywhere, however cargo-install-update-config (manpage) allows you to do just that!

In your case the invocation should be

cargo install-update-config nu --feature stable

(note: previous versions of this document specified that as cargo install-update-config --feature stable nu, which illustrated the point, but didn't strictly work; thanks to @FranzStrudel for reporting this)

Amanita-muscaria commented 4 years ago

Awesome! Thanks!

FranzStrudel commented 4 years ago

The syntax seems to have changed, the invocation would now be:

cargo install-update-config - --feature stable nu

(Note the - between config and --feature)

nabijaczleweli commented 4 years ago

Following the suggestion from clap leads to a more reasonable solution:

nabijaczleweli@tarta:~$ cargo install-update-config --feature stable nu
error: The following required arguments were not provided:
    <PACKAGE>

USAGE:
    cargo-install-update-config install-update-config <PACKAGE> --feature <FEATURE>...

For more information try --help
nabijaczleweli@tarta:~$ cargo install-update-config nu --feature stable
Default features  true
Features          stable

nabijaczleweli@tarta:~$ l $(which cargo-install-update-config)  # Tested version/stamp:
-rwxr-xr-x 1 nabijaczleweli users 3.8M Mar 11 02:15 /home/nabijaczleweli/.cargo/bin/cargo-install-update-config
nabijaczleweli@tarta:~$ cargo install-update-config --help | head -1
cargo-install-update-config-install-update-config 3.0.

Looking at the blame on options.rs, it looks like the latest non-NFC change was 5813adc0763cb64b54c485dbf61b253a52e2b000 from 10 months ago (which wouldn't have changed the schema), and the rest are the initial implementation from 2017 (three years ago!).

As such, I'm pretty sure that the code above is a typo and I didn't actually run that invocation (hence "should").

I've updated the comment, thanks!