add ability to optimize dependencies in dev#2380
add ability to optimize dependencies in dev#2380matklad wants to merge 3 commits intorust-lang:masterfrom
Conversation
|
r? @wycats (rust_highfive has picked a reviewer for you, use r? to override) |
src/cargo/ops/cargo_rustc/context.rs
Outdated
| return &self.profiles.dev | ||
| } | ||
|
|
||
| if let Some(ref id) = self.build_config.deps_profile { |
There was a problem hiding this comment.
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.
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
cargorun. But the decision about profile for deps should be unique withing a singlecargorun.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?