-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Split off from #3194.
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
profilesection 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? :)