Skip to content

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

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.

Activity

  1. added
    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
    on May 28, 2019
  2. changed the title [-]--debug/--release shiuld be accepted by run/build/install/test/...[/-] [+]--debug/--release should be accepted by run/build/install/test/...[/+] on May 28, 2019
  3. ehuss commented on May 28, 2019

    @ehuss
    Contributor

    After custom named profiles is done (#6989), the intent is that --profile=release or --profile=debug will address this.

  4. RalfJung commented on May 28, 2019

    @RalfJung
    MemberAuthor

    So with that, install --profile=release would definitely be redundant, as would build --profile=debug?

  5. ehuss commented on May 28, 2019

    @ehuss
    Contributor

    Yes.

  6. RalfJung commented on May 28, 2019

    @RalfJung
    MemberAuthor

    That sounds great. :)

  7. ehuss commented on Jun 24, 2019

    @ehuss
    Contributor

    Closing in favor of the #6988 tracking issue.

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

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