You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently workspaces do not work really well with profiles. Suppose you have two crates, foo and bar, both of them have a profile section and bar depends on foo. If you invoke cargo build inside foo package and inside bar package, then the bar package will be build twice with different profiles!
The property we want here is this "a package of the workspace is always build with the same profile, regardless of place where cargo build was invoked".
This can be achieved in one of the two ways:
Use the single profile configuration for the whole workspace.
When building a workspace package, always use its own profile.
I think it's simpler and better to implement 1), and perhaps add per package overrides in the future.
To implement 1), we should:
add a profile section to the virtual manifest,
start to produce a warning if the non-root member of the workspace specifies profiles,
switch the behavior to always use the profiles from the root of the workspace.
Does this sound reasonable? :)
The text was updated successfully, but these errors were encountered:
Sounds good to me! I do think that we'll need a warning here for a bit as this wasn't implemented just yet, but we don't have to leave the warning in for too too long I think.
Use a single profile set per workspace
This aims to close#3206.
I have not figured out how to do this 100% backward compatibly, that's why I want to discuss this separately, although a related PR (#3221) is already in flight.
The problem is this: suppose that you have a workspace with two members, A and B and that A includes a profiles section and B does not. Now, mentally `cd` inside B and run `cargo build`. Today, Cargo will use a default profile. We want it to use a profile from A. So here the silent behavior switch will inevitably occur :( Looks like we can't detect this situation.
So this PR just switches the behavior to always use root profiles, and to print a warning if a non-root package specifies profiles. Feel free to reuse it in any form for #3221 if that's convenient!
Split off from #3194.
Currently workspaces do not work really well with profiles. Suppose you have two crates,
foo
andbar
, both of them have aprofile
section andbar
depends onfoo
. If you invokecargo build
insidefoo
package and insidebar
package, then thebar
package will be build twice with different profiles!The property we want here is this "a package of the workspace is always build with the same profile, regardless of place where
cargo build
was invoked".This can be achieved in one of the two ways:
Use the single profile configuration for the whole workspace.
When building a workspace package, always use its own profile.
I think it's simpler and better to implement 1), and perhaps add per package overrides in the future.
To implement 1), we should:
profile
section to the virtual manifest,Does this sound reasonable? :)
The text was updated successfully, but these errors were encountered: