Skip to content

Build only the default run binary #9491

@dzfranklin

Description

@dzfranklin

I'd like a way to build only the default run binary, i.e. what cargo run runs. (I'm writing a subcommand that lets the user run the various binaries cargo builds under a time-travelling debugger. By default, I want to build and run only the default run binary)

Describe the solution you'd like

Either cargo build --default-bin, or some way to get the name of the default binary.

(I think --no-run is being phased out. If not, cargo run --no-run could also be added, although it sounds a little silly.)

Notes

If this is a wontfix I'd like to confirm that the algorithm used by cargo run is as follows.

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-run

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions