nabijaczleweli / cargo-update

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

Is "cargo install-update" still working? #68

Closed matthiaskrgr closed 6 years ago

matthiaskrgr commented 6 years ago
cargo 1.26.0-nightly (d6c3983fe 2018-03-16)
release: 1.26.0
commit-hash: d6c3983fe3bd8fa06b54712e53fb23645598188b
commit-date: 2018-03-16
~/.cargo/bin/cargo-install-update install-update -lag

does work, however

cargo install-update -lag

does not (I'm 99% sure it did before! :/) I'm not sure what the error is here...

error: The subcommand 'install-update' wasn't recognized
        Did you mean 'install'?
If you believe you received this message in error, try re-running with 'cargo -- install-update'
USAGE:
    cargo [OPTIONS] [SUBCOMMAND]
For more information try --help

Cargo had some changes to its cmdine arg parsing, maybe this broke something here?

It'd kind of weird though, I have my own cargo plugin "cargo-cache" which I can still use via "cargo cache", I don't understand why cargo install update would break but cargo cache would not.

mati865 commented 6 years ago

Cargo was migrated to clap recently: https://github.com/rust-lang/cargo/pull/5152 cargo-outdated and cargo-edit are another victims here.

EDIT: clap issue: https://github.com/kbknapp/clap-rs/pull/1215

nabijaczleweli commented 6 years ago

That means that should be resolved when someone decides to update cargo's clap dep (why they can't just specify down to minor as opposed to to patch will forever remain a mystery to me). Will close then.

kbknapp commented 6 years ago

@matklad is aware of this issue, and it's fixed in upstream clap. So I'm assuming this will be fixed in the next nightly version of cargo.

matklad commented 6 years ago

I think this issue could be closed, because it has nothing to do with cargo-update per se. The PR to rust is waiting for bors.

why they can't just specify down to minor as opposed to to patch will forever remain a mystery to me

So, we specify the requirements for clap version here: https://github.com/rust-lang/cargo/blob/d10ec661b06420654bbc4ed0ccd32295698aa1dc/Cargo.toml#L56. Note that clap = "2.31.2" means the same as clap = "^2.31.2". That is, even if you specify patch version, Cargo would use a later patch, if available. The reason why we specify patch version is because we want to explicitly forbid 2.31.1 just in case.

Note, however, that this is only requirement, the actual version of clap, used by production builds of Cargo is specified in the lockfile in the rust-lang/rust repository: https://github.com/rust-lang/rust/blob/6bfa7d02d6713acd15ead20c199b808e85031f9e/src/Cargo.lock#L187

We need that lockfile, as usual, to make sure that the builds of rustc/cargo/rls and others are reproducible. For example, just updating from clap 2.31.1 to 2.31.2 would have broken a single test in Cargo which, accidentally, relied on the previous wrong behavior.

Hopefully this clarifies situation a bit about version of packages, used in Cargo :)

And sorry once again for this disruption!

nabijaczleweli commented 6 years ago

Ah, thanks for clearing up how semvers degenerate into semver reqs!

Closing since relevant external issue just closed.

nabijaczleweli commented 6 years ago

Quoth @kbknapp:

This has finally made it into the latest nightly cargo build too - so the fix is rustup update nightly.