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

Build only the default run binary #9491

Closed
dzfranklin opened this issue May 16, 2021 · 2 comments
Closed

Build only the default run binary #9491

dzfranklin opened this issue May 16, 2021 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-run

Comments

@dzfranklin
Copy link

dzfranklin commented May 16, 2021

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.

@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 16, 2021
@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/cargo meeting. We'd be fine with an option to build what cargo run would run, but it should definitely be a cargo build option (e.g. --default-bin); we felt it would be confusing to have cargo run --no-run when what you're actually asking for is to build and not run.

On the other hand, you also filed #9497 to provide this information in cargo metadata, and our general sentiment in the meeting was that if metadata would suffice we'd be much happier providing it that way and not adding a new command-line option to cargo build.

Would metadata suffice for your use case?

@dzfranklin
Copy link
Author

Hi Josh, sorry I missed your reply. Metadata would be sufficient.

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-run
Projects
None yet
Development

No branches or pull requests

3 participants