Skip to content

Specify "default-run" binary in a workspace project #7290

Closed

Description

Describe the problem you are trying to solve
I have a workspace project with a Cargo.toml in the root, then various sub-projects in sub-folders, each with their own Cargo.toml files that specify specific packages (libs or binaries).

I often have to execute one of the resulting binaries on test apps during development.

I am pleased to see the addition of the "default-run" key to Cargo.toml in packages section.
In general this will help.
In this project I don't have any sub-project that has multiple binaries built.
I do have multiple binaries built in the overall workspace, one in each of a number of sub-projects.

Describe the solution you'd like
I would like to be able to specify "default-run" in the root workspace Cargo.toml file, so from the project root I can run "cargo run -- " on some test files, without having to specify the binary with --bin <binary_name> each time.

Notes
Not sure under which key would make sense in the workspace toml.
Format something like:
default-run = "sub-folder/binary_name" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions