nabijaczleweli / cargo-update

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

`install.root` is not properly followed #258

Open Skgland opened 4 months ago

Skgland commented 4 months ago

I believe #23 is (partially) broken again. install.root Cargo config value appears to not be handled properly.

When I run cargo install-update -a it finds the packages to update (so it searches the .crates.toml/.crates2.json in the right place), but then it installes the updates into ~/.cargo/bin for some reason.

PS C:\Users\Bennet> cargo install-update --version
cargo-install-update 13.4.0
PS C:\Users\Bennet> cargo install-update --all
    Polling registry 'https://index.crates.io/'............

Package       Installed  Latest                               Needs update
cargo-audit   v0.18.3    v0.20.0                              Yes
cargo-deny    v0.14.3    v0.14.23                             Yes
flamegraph    v0.6.4     v0.6.5                               Yes
just          v1.16.0    v1.25.2                              Yes
biodiff       v1.2.1     v1.2.1                               No
cargo-cache   v0.8.3     v0.8.3                               No
cargo-edit    v0.12.2    v0.12.2                              No
cargo-msrv    v0.15.1    v0.15.1 (v0.16.0-beta.20 available)  No
cargo-update  v13.4.0    v13.4.0                              No
cbindgen      v0.26.0    v0.26.0                              No
diskonaut     v0.11.0    v0.11.0                              No
ripgrep       v14.1.0    v14.1.0                              No

Updating cargo-audit
    Updating crates.io index
  Installing cargo-audit v0.20.0
    Updating crates.io index
<!-- SNIP -->
   Compiling cargo-audit v0.20.0
    Finished release [optimized] target(s) in 2m 04s
  Installing C:\Users\Bennet\.cargo\bin\cargo-audit.exe
   Installed package `cargo-audit v0.20.0` (executable `cargo-audit.exe`)
<!-- SNIP -->

While cargo install cargo-audit works correctly

PS C:\Users\Bennet> cargo install cargo-audit
    Updating crates.io index
  Installing cargo-audit v0.20.0
    Updating crates.io index
<!-- SNIP -->
   Compiling cargo-audit v0.20.0
    Finished release [optimized] target(s) in 2m 03s
   Replacing \\NAS\Some\Path\bin\cargo-audit.exe
    Replaced package `cargo-audit v0.18.3` with `cargo-audit v0.20.0` (executable `cargo-audit.exe`)
nabijaczleweli commented 4 months ago

and, pray tell, what would that config be?

Skgland commented 4 months ago

In C:\Users\Bennet\.cargo\config.toml

[install]
root = "\\\\NAS\\Some\\Path"

Which should correspond to %USERPROFILE%\.cargo\config.toml listed in https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure