cargo install should not need to build the crate to determine there is no binary available
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
cargo-lock is a good example of this. cargo-lock only provides a binary with --features cli. If a user doesn't notice this and instead just executes cargo install cargo-lock with a clean build cache, cargo will happily build the cargo-lock library along with all its dependencies before erroring out noting that there are no binaries available.
Since the presence of a binary crate target doesn't require building the crate to discover, it would be better if cargo could give the error before spending CPU time on building the crate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the cargo install target-discovery and error path, using cargo-lock's feature-gated CLI target as the reproducing case. Done means cargo reports the absence of an available binary before compiling the crate or its dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100