nabijaczleweli / cargo-update

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

cargo install-update doesn't install updates. #267

Closed Joshix-1 closed 2 months ago

Joshix-1 commented 2 months ago

bacon released v2.20.0, but that doesn't get installed.

$ cargo install-update -ga
    Polling registry 'https://index.crates.io/'........................................

Package          Installed  Latest    Needs update
bacon            v2.19.0    =2.19.0   No
...
$ jq < ~/.cargo/.crates2.json | head
{
  "installs": {
    "bacon 2.19.0 (registry+https://github.com/rust-lang/crates.io-index)": {
      "version_req": "=2.19.0",
      "bins": [
        "bacon"
      ],
      "features": [],
      "all_features": false,
      "no_default_features": false,
Joshix-1 commented 2 months ago

probably caused by https://github.com/nabijaczleweli/cargo-update/commit/e82363cd5172efed30ec67b365c71030c7597f90

nabijaczleweli commented 2 months ago

You have "version_req": "=2.19.0", configured (this is shown in the Latest column, cargo install-update-config bacon will also show this). There is no newer package that satisfies this requirement, so there is no update to be installed.

Did you install with cargo install bacon=2.19.0 (or --version 2.19.0? or something?).

Joshix-1 commented 2 months ago

I've installed it months ago and probably installed the latest version with cargo install-update. I never personally fixed the version

Joshix-1 commented 2 months ago

But yes, it was probably last installed with --version https://github.com/nabijaczleweli/cargo-update/blob/master/src/main.rs#L239 if i read the code correctly.

nabijaczleweli commented 2 months ago

hm, this implies that cargo install --version didn't use to(?) save the argument in version_req but now does (and thus naturally we need to ignore version_req). need to confirm

nabijaczleweli commented 2 months ago

looks like this has always been true (but blaming through cargo is hell, so maybe not)

Can you try the current master branch (at least f621390815d43d0b1caaf9d753131009da4fb8b6)?

Joshix-1 commented 2 months ago
$ cargo install --git https://github.com/nabijaczleweli/cargo-update
    Updating git repository `https://github.com/nabijaczleweli/cargo-update`
  Installing cargo-update v14.0.0 (https://github.com/nabijaczleweli/cargo-update#f6213908)
...
$ cargo install-update -ga
    Polling registry 'https://index.crates.io/'.......................................

Package          Installed  Latest    Needs update
bacon            v2.19.0    v2.20.0   Yes
...

seems to work

nabijaczleweli commented 2 months ago

Released in v14.0.1