-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workspaces: Cargo profiles should be shared among all workspace members. #3206
Comments
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. |
bors
added a commit
that referenced
this issue
Nov 4, 2016
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!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: