Skip to content

Allow specifying build dependencies opt-level with [project.dev.build-override.package] #16193

@mkurnikov

Description

@mkurnikov

Problem

We have a compiler + VM monorepo with a build step, where we compile a standard library to include into the executable later.
The step itself depends on the part of the monorepo, and it's dependency tree is around 700 crates. But the actual compilation is mostly happens in one compiler crate.

I want to compile that compiler crate with opt-level = 1. This way, the compilation step reduced from 70s to 20s.
But I don't want to compile with opt-level = 1 the whole set of 700 crates of build dependencies.

Proposed Solution

There already a [profile.dev.build-override] which allow to specify opt-level for the whole set of [build-dependencies].
There's also [profile.dev.package] which allows specifying compiler.opt-level = 1.
I want to have

[profile.dev.build-override.package]
compiler.opt-level = 1

which combines those two together.

Notes

The idea has been mentioned before in #7940, but the discussion there seem to be focused on the library crates.
I want to control the opt-level myself.

I can contribute the feature if it deemed acceptable - building blocks are already in-place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsA-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