Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show features with cargo install --list #13353

Open
smoelius opened this issue Jan 27, 2024 · 3 comments
Open

Show features with cargo install --list #13353

smoelius opened this issue Jan 27, 2024 · 3 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@smoelius
Copy link
Contributor

Problem

Show the features that were selected when a package was installed.

Proposed Solution

Display this additional information when -v/--verbose is passed.

E.g., something like this:

$ cargo install --list
...
cargo-audit v0.18.3:
    cargo-audit
cargo-dylint v2.6.1:
    cargo-dylint
cargo-hack v0.6.15:
    cargo-hack
...
$ cargo install --list --verbose
...
cargo-audit v0.18.3:
    cargo-audit
cargo-dylint v2.6.1 (features: metadata-cli):
    cargo-dylint
cargo-hack v0.6.15:
    cargo-hack
...

Notes

Would you be open to a PR to do this?

@smoelius smoelius added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jan 27, 2024
@epage
Copy link
Contributor

epage commented Jan 27, 2024

Overall, I can't think of any concerns. For myself, I would like to better understand the situation. I don't think I've ever changed the features of the CLIs I use (or known they had other features). Is this a fairly common thing you run into? In what way is seeing the feature helpful to you (I also forget --list exists)?

@smoelius
Copy link
Contributor Author

Is this a fairly common thing you run into?

I don't know how common it is for CLI tools to have features. But a GitHub search shows that some popular tools do, e.g.,:

Frankly, I want this for my self. I have a tool with an optional, experimental feature. I want to be able to easily tell whether I installed the tool with that feature enabled.

In what way is seeing the feature helpful to you (I also forget --list exists)?

In addition to the points above, Cargo will install over an existing package if the selected features differ. So, knowing what features were enabled when a tool was installed can help you to know whether a subsequent cargo install is necessary/will succeed. E.g.:

cargo install ripgrep
cargo install ripgrep # doesn't work
cargo install ripgrep --features=pcre2
cargo install ripgrep # works

@weihanglo
Copy link
Member

know whether a subsequent cargo install is necessary/will succeed.

This part sounds pretty similar to #11123

@epage epage added S-needs-team-input Status: Needs input from team on whether/how to proceed. and removed S-triage Status: This issue is waiting on initial triage. labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

3 participants