Skip to content

Allowing different opt-level for different crates of the workspace #56454

@Boscop

Description

@Boscop

I have two crates in a workspace: backend server and wasm frontend (and a shared crate for the API types).
I want to use the following profile only for the frontend crate:

[profile.release]
lto = true
opt-level = "z"

I only want to optimize my frontend for size, but the backend server for speed.

But:

warning: profiles for the non root package will be ignored, specify profiles at the workspace root

Why can't this be allowed?

I'd really like to avoid having to split the frontend off into a separate workspace, is there a solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions