Skip to content

feature: default-run included in cargo metadata #9497

@dzfranklin

Description

@dzfranklin

Describe the problem you are trying to solve

I'm writing a subcommand that mirrors cargo, but records things under a time-travelling debugger instead of running them. When someone types cargo rr run I need to get whatever binary cargo would have run.

In #9491 I requested a solution for this specific use case (something like cargo build --default-bin). When looking into replicating the algorithm cargo uses as a workaround I learned cargo doesn't expose the field default_run in cargo metadata.

Describe the solution you'd like

The default_run field under [package] in Cargo.toml is included in cargo metadata

Notes

Based on a cursory look I think this would just require adding a field to SerializedPackage and changing Package::serialized to propagate the field value from Manifest. I'd be happy to file a PR for this.

Metadata

Metadata

Assignees

Labels

C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-metadataE-easyExperience: Easy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions