Skip to content

--debug/--release should be accepted by run/build/install/test/... #6992

@RalfJung

Description

@RalfJung

Describe the problem you are trying to solve

I am writing a script that wraps cargo, and lets the user pass flags to it. Per default I want everything to be done in release mode, but the user should be able to select debug mode.

Unfortunately, the way to do that is non-uniform: install defaults to release and can be passed --debug; build defaults to debug can can be passed --release. This all makes sense, but what is frustrating is that I cannot do install --release or build --debug, so now I need some complicated logic to strip away the --release flag when we are installing or the --debug flag when we are building.

Describe the solution you'd like

I'd like a consistent way to force debug/release builds across all cargo commands, mostly to avoid needlessly rebuilding stuff. So all applicable commands should accept --debug to do a debug build even if that is their default, and same for --release.

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`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions