nabijaczleweli / cargo-update

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

Can't update binaries that require additional features #233

Closed ahlinc closed 1 year ago

ahlinc commented 1 year ago

Hi! Thank you for the awesome tool that saves a lot of time!

Recently I saw a situation that the cargo install-update --all command wasn't able to update binaries that require that some features to be enabled.

![Screenshot from 2023-04-24 22-44-04](https://user-images.githubusercontent.com/14666676/234100041-8555041a-2cb9-4b86-8d29-367ab5088b6b.png)

It would be good if the tool would understand that a binary already is installed so it make sense to enable required-features by default.

nabijaczleweli commented 1 year ago

Manual says: cargo install-update-config -f cli tree-sitter-graph, re-run

ahlinc commented 1 year ago

@nabijaczleweli thank you for pointing to the man. But is it possible to happen automatically for base features that are mentioned in required-features? The cargo install-update-config command can be used to enable additional features for a binary to enable, e.g., some additional functionality, but the base required features are the base and may be handled automatically.

nabijaczleweli commented 1 year ago

I don't get this. If you want non-default features then set them? This is how everything else works.

Also, not only is this not what cargo does:

$ CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse cargo install tree-sitter-graph
    Updating crates.io index
  Downloaded tree-sitter-graph v0.9.2
  Downloaded 1 crate (69.9 KB) in 1.14s
  Installing tree-sitter-graph v0.9.2
    Updating crates.io index
  Downloaded serde v1.0.160
  Downloaded proc-macro2 v1.0.56
  Downloaded string-interner v0.12.2
  Downloaded ahash v0.4.7
  Downloaded hashbrown v0.9.1
  Downloaded serde_json v1.0.96
  Downloaded tree-sitter v0.20.10
  Downloaded aho-corasick v1.0.1
  Downloaded syn v2.0.15
  Downloaded regex-syntax v0.7.1
  Downloaded regex v1.8.1
  Downloaded 11 crates (1.5 MB) in 0.90s
   Compiling proc-macro2 v1.0.56
   Compiling unicode-ident v1.0.8
   Compiling quote v1.0.26
   Compiling memchr v2.5.0
   Compiling cc v1.0.79
   Compiling serde v1.0.160
   Compiling regex-syntax v0.7.1
   Compiling ahash v0.4.7
   Compiling thiserror v1.0.40
   Compiling log v0.4.17
   Compiling serde_json v1.0.96
   Compiling cfg-if v1.0.0
   Compiling ryu v1.0.13
   Compiling itoa v1.0.6
   Compiling smallvec v1.10.0
   Compiling hashbrown v0.9.1
   Compiling string-interner v0.12.2
   Compiling aho-corasick v1.0.1
   Compiling tree-sitter v0.20.10
   Compiling syn v2.0.15
   Compiling regex v1.8.1
   Compiling thiserror-impl v1.0.40
   Compiling tree-sitter-graph v0.9.2
    Finished release [optimized] target(s) in 21.69s
warning: none of the package's binaries are available for install using the selected features

This is not set in the index:

index.crates.io-6f17d22bba15001f/.cache/tr/ee$ split -t'\0' tree-sitter-graph -l1
index.crates.io-6f17d22bba15001f/.cache/tr/ee$ grep -oaE '.{1,30}cli.{1,30}' xa?
xah:a17d0870a1c6f55","features":{"cli":["clap","tree-sitter-config"
xaj:70b2f56c24972aa","features":{"cli":["clap","tree-sitter-config"
xal:b00483bf39a7a96","features":{"cli":["clap","env_logger","tree-s
xan:400134b61d967bd","features":{"cli":["clap","env_logger","tree-s
xap:9b82d9741129ec2","features":{"cli":["clap","env_logger","tree-s
xar:9739e410d51026d","features":{"cli":["clap","env_logger","tree-s
xat:0f2927a2f3ab17d","features":{"cli":["clap","env_logger","tree-s
xav:c359abb19732e02","features":{"cli":["anyhow","clap","env_logger
xax:a159b243ba1f97a","features":{"cli":["anyhow","clap","env_logger
xaz:1bb1af495f8cde4","features":{"cli":["anyhow","clap","env_logger

Plus, in this case, it's very explicitly configuration for which binaries you want. The default is none. If you want the "cli"-group ones you build with -fcli. Simple as.

ahlinc commented 1 year ago

Thank you for explaining, I see that there is no the required-features in the index.