nabijaczleweli / cargo-update

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

unnecessary configurations written to ~/.cargo/.install_config.toml #268

Closed Joshix-1 closed 2 months ago

Joshix-1 commented 2 months ago

When configuring options for one package it updates options (probably based on stuff in ~/.cargo/.crates2.json) for other packages. That imho shouldn't happen. It configures options for many packages without telling the user.

$ echo "" > ~/.cargo/.install_config.toml
$ wc < ~/.cargo/.install_config.toml
1 0 1
$ cargo install-update-config -a bacon
No configuration for package bacon.
$ wc < ~/.cargo/.install_config.toml
 167  299 2184
$ head ~/.cargo/.install_config.toml
[bfy]
default_features = true
features = []

[cargo-auditable]
default_features = true
features = []

[cargo-bloat]
default_features = true
nabijaczleweli commented 2 months ago

cargo install-update-config reads the real and .crates2.json config, and if any edits are configured, writes it all to the real config

this makes the semi-transient .crates2.json-originating config real and permanent. which I agree is bad

nabijaczleweli commented 2 months ago

Can you try the current master branch (at least a5fedc7e9e9670330ba4e9d3096a0b82de424f47)? The current persistent config file won't be pruned, but now a .crates2.json-originating config will only be promoted and saved if you're actually editing that package's config.

Joshix-1 commented 2 months ago

seems to work

nabijaczleweli commented 2 months ago

Thanks; released in v14.0.2.