feat(config): Add build.profile, install.profile - #17215
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
1127b1e to
2add9e9
Compare
This comment has been minimized.
This comment has been minimized.
### What does this PR try to resolve? Key points: - It inherits from `dev` - Conceptually, debugging is part of the development process - The hope is this will smooth out the transition for people - `cargo install --debug` now uses `debug` instead of `dev` - `debug` changes nothing from `dev` right now. `dev` will evolve in the future (with `debug` overriding those values to leave it effectively unchanged) but that is deferred out to offer a transition period where `debug` can be used without but isn't required for debugging as people deal with multiple Rust versions. This also shrinks the change and decouples what the conversation around what the settings should be. - `dev` still uses `target/debug`: this does not change any calculation for the transition cost and any conflicts between the profiles should mostly be in the artifact-dir (which are just hard links), especially once the new build layout lands - `--dev`/`--debug` flags are deferred out, needing more evaluation to decide if they are worth it See also https://github.com/rust-lang/cargo-team/blob/main/meetings/sync-meeting/2026-07-14.md#splitting-dev-and-debug-profiles ### How to test and review this PR? This is part of #15931 - `build.profile` will be a follow up (#17215) - `dev` profile changes are deferred for 1+ releases
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
621897e to
b6187f7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
How should
testandbenchbe handled? We went withcargo testhavingbuild.profileoverride the defaulttestso users will get consistent behavior betweencargo buildandcargo test. Alternatively, we could have told users to setprofile.test.inherits = "debug". Changing the inheritance is even less obvious though it is likely to run into fewer issues if projects change thetestprofile.
How do we communicate and document this? Do we need to decide before proceeding?
There was a problem hiding this comment.
My assumption is that this will behave as people expect and the only documentation burden is on the fields. If there is something I'm overlooking, let me know!
This comment has been minimized.
This comment has been minimized.
| * Default: `"dev"` | ||
| * Environment: `CARGO_BUILD_PROFILE` | ||
|
|
||
| The default [profile] to compile with. |
There was a problem hiding this comment.
I think this might need to be expanded. For example, explaing what scope it apply to, and the relationship with bench and test profiles. The tricky part is the default is not always dev for different scope. We should point that one.
(It's okay to be a bit vague, if we plan to change it in the future)
There was a problem hiding this comment.
I'm cautious about getting into test and bench profiles because I expect most people don't know about them and could cause more confusion.
Unsure how to handle the install/bench nuance. “for development tasks"?
There was a problem hiding this comment.
I'm cautious about getting into
testandbenchprofiles because I expect most people don't know about them and could cause more confusion.
I got a different impression that because people tend to tweak profile.test profile for either a faster test execution time, or just want to coerce that to match release profile in order to reuse cache.
There was a problem hiding this comment.
For bench, yeah people just don't care about it, as keeping the same as release is pretty reasonable.
There was a problem hiding this comment.
I've at least changed the default. Still a bit unsure what else to say here.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Before kicking off the FCP, would you mind sharing the complete transition plan with this feature? |
This comment has been minimized.
This comment has been minimized.
411116f to
14c67c3
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Not too sure what more you are looking for. The PR description talks about this easing the transition to the split dev/debug profiles by allowing people to choose to switch to |
I actually forgot what I was looking for. @rfcbot fcp merge This insta-stabilizes two new configs: |
|
@weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
View all comments
What does this PR try to resolve?
This adds
build.profileto smooth out the transition for #15931 by allowing users to change to thedebugprofile by default.This also adds
install.profilebuild.profiledoes not applyHow to test and review this PR?
This is part of #15931
devprofile changes are deferred for 1+ releasesHow should
testandbenchbe handled? We went withcargo testhavingbuild.profileoverride the defaulttestso users will get consistent behavior betweencargo buildandcargo test. Alternatively, we could have told users to setprofile.test.inherits = "debug". Changing the inheritance is even less obvious though it is likely to run into fewer issues if projects change thetestprofile.