Skip to content

Support opt-level ranges to avoid building twice with different opt-level values #8502

Open
@joshtriplett

Description

@joshtriplett

#8500 will change Cargo's default opt-level for build dependencies to 0. However, if a crate will also be built as a runtime dependency, that would result in Cargo building it twice, once with opt-level 0 and once with opt-level 3. We should have a way of specifying the default as having a minimum opt-level of 0, but allowing a higher opt-level. Then, Cargo could unify that and just build once, leaving build-time-only dependencies unoptimized, but optimizing dependencies shared between build-time and runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-profilesArea: profilesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions