Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: default-run included in cargo metadata #9497

Closed
dzfranklin opened this issue May 18, 2021 · 3 comments · Fixed by #9550
Closed

feature: default-run included in cargo metadata #9497

dzfranklin opened this issue May 18, 2021 · 3 comments · Fixed by #9550
Assignees
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-metadata E-easy Experience: Easy

Comments

@dzfranklin
Copy link

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.

@dzfranklin dzfranklin added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label May 18, 2021
@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/cargo meeting, and we'd be entirely in favor.

@ehuss ehuss added Command-metadata E-easy Experience: Easy labels Jun 2, 2021
@Rustin170506
Copy link
Member

@danielzfranklin @ehuss I would like to try to add it.

@Rustin170506
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-metadata E-easy Experience: Easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants