Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specific profiles for workspace members

Is it possible to specify specific profiles for members of a workspace? If I write a profile into the member Cargo.toml I get:

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

I also tried to put a specific profile into workspace root's Cargo.toml:

[profile.release]
opt-level = 3

[profile.release.hal]
# optimizer kills assembly code
opt-level = 1

However, it seems to be ignored too, as the applied options in the the verbose output show:

Running `rustc --crate-name hal src/hal/lib.rs --crate-type lib -C opt-level=3 --emit=dep-info,link [...]

Is there any other way beside avoiding workspaces at all?

like image 431
Matthias Avatar asked Aug 21 '17 10:08

Matthias


People also ask

How do I customize my slack profile?

From your desktop, click your profile picture in the top right. Click Profile. Click Edit. Edit your profile, then click Save Changes.

What is a rust workspace?

A workspace is a set of packages that share the same Cargo.lock and output directory. Let's make a project using a workspace—we'll use trivial code so we can concentrate on the structure of the workspace. There are multiple ways to structure a workspace, so we'll just show one common way.


1 Answers

This is now supported and stabilized since Rust 1.43:

[profile.release]
opt-level = 3

[profile.release.package.hal]
# optimizer kills assembly code
opt-level = 1

See: https://doc.rust-lang.org/cargo/reference/profiles.html#overrides

like image 158
Alvin Wong Avatar answered Nov 10 '22 08:11

Alvin Wong