Skip to content

cargo install should not need to build the crate to determine there is no binary available #8970

@CAD97

Description

@CAD97

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-installS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions