-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add ability to optimize dependencies in dev #2380
Conversation
r? @wycats (rust_highfive has picked a reviewer for you, use r? to override) |
return &self.profiles.dev | ||
} | ||
|
||
if let Some(ref id) = self.build_config.deps_profile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this check should probably come first before the check for --release
as the release profile may want to switch profiles as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this makes sense. My motivation was that --release
should always mean release and compile everything with maximum optimizations. But there should be no harm in allowing more flexibility here.
Thanks @matklad! Some thoughts of mine:
This may also be a bit premature for shining the spotlight on profiles, they're still pretty half baked unfortunately. |
I've implemented this, but I'm still not sure it is the best option :)
Yeah, I see there is a tension between |
Thanks! The implementation here looks pretty good to me. I'm not too worried about kinda the "purity" of a Profile today, it seems fine to evolve over time. Some issues that I know of around profiles are:
Right now the only real guarantees you have about profiles are:
And... that may be it? |
I got a chance to talk about this with @wycats today and the conclusion we reached was:
For these reasons I'm going to close for now, but we can continue discussing on the issue! |
fixes #1359
Ok, I've tried to implement what we've discussed so far (with "non-local", and a package level toml option).
I agree about "local decision", but I'm not sure about "per-profile". As I see it, several profiles may be used for different packages during a single
cargo
run. But the decision about profile for deps should be unique withing a singlecargo
run.I am afraid, we won't be able to find the right solution here until we have custom profiles, improve dev/test thing and resolve #2085. What would be the conservative option here? Overriding profile for dependencies only in dev mode?