Skip to content

feat(config): Add build.profile, install.profile - #17215

Merged
rustbot merged 3 commits into
rust-lang:masterfrom
epage:config-profile
Sep 25, 2026
Merged

rustbot merged 3 commits into
rust-lang:masterfrom
epage:config-profile

Conversation

@epage

@epage epage commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

What does this PR try to resolve?

This adds build.profile to smooth out the transition for #15931 by allowing users to change to the debug profile by default.

This also adds install.profile

  • to further clarify that build.profile does not apply
  • to allow users to create a custom profile for their tools without affecting the rest of their development

How to test and review this PR?

This is part of #15931

  • dev profile changes are deferred for 1+ releases

How should test and bench be handled? We went with cargo test having build.profile override the default test so users will get consistent behavior between cargo build and cargo test. Alternatively, we could have told users to set profile.test.inherits = "debug". Changing the inheritance is even less obvious though it is likely to run into fewer issues if projects change the test profile.

@rustbot

rustbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, weihanglo

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-profiles Area: profiles Command-clean Command-install Command-test S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2026
@epage
epage marked this pull request as draft July 14, 2026 20:23
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 14, 2026
@epage
epage force-pushed the config-profile branch 4 times, most recently from 1127b1e to 2add9e9 Compare July 16, 2026 14:08
@rustbot

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Jul 17, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Aug 7, 2026
### 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
@rustbot

This comment has been minimized.

@epage
epage marked this pull request as ready for review August 10, 2026 17:06
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2026
@epage epage changed the title Config profile feat(config): Add build.profile, install.profile Aug 10, 2026
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-rfcbot rust-rfcbot added finished-final-comment-period FCP complete S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. to-announce and removed final-comment-period FCP — a period for last comments before action is taken labels Sep 25, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

@rustbot

rustbot commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

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.

@weihanglo weihanglo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #17503 got already mergeed and I don't expect another cargo submodule sync before new nightly branches off, let us merge this 🎉

@rustbot merge

View changes since this review

@rustbot
rustbot enabled auto-merge September 25, 2026 18:40
@rustbot
rustbot added this pull request to the merge queue Sep 25, 2026
Merged via the queue into rust-lang:master with commit 07b8049 Sep 25, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2026
epage added a commit to epage/cargo that referenced this pull request Sep 26, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

Fixes rust-lang#15931
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 30, 2026
Update cargo submodule

8 commits in 3d7cf6e937d6127d0f49881bf689c560b36d35c4..f3865b2a4d1acc5276f6b3c67d0e057f4dab3928
2026-09-25 01:47:29 +0000 to 2026-09-29 19:58:08 +0000
- fix(config): Proper dotted tuple support with legacy fallback (rust-lang/cargo#17536)
- refactor: Rename internal content from target-triple to target-tuple (rust-lang/cargo#17535)
- docs(changelog): remove duplicate items (rust-lang/cargo#17528)
- chore: bump to 0.102.0; update changelog (rust-lang/cargo#17525)
- feat(metadata): mirror package features in features_v2 (rust-lang/cargo#17517)
- feat(config): Add build.profile, install.profile (rust-lang/cargo#17215)
- feat(builtin-deps): Add `SourceKind::Builtin` (rust-lang/cargo#17513)
- fix(compilation): Preventing OUT_DIR env var from leaking into cargo run after build.rs run (rust-lang/cargo#17503)

r? ghost
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Sep 30, 2026
Update cargo submodule

8 commits in 3d7cf6e937d6127d0f49881bf689c560b36d35c4..f3865b2a4d1acc5276f6b3c67d0e057f4dab3928
2026-09-25 01:47:29 +0000 to 2026-09-29 19:58:08 +0000
- fix(config): Proper dotted tuple support with legacy fallback (rust-lang/cargo#17536)
- refactor: Rename internal content from target-triple to target-tuple (rust-lang/cargo#17535)
- docs(changelog): remove duplicate items (rust-lang/cargo#17528)
- chore: bump to 0.102.0; update changelog (rust-lang/cargo#17525)
- feat(metadata): mirror package features in features_v2 (rust-lang/cargo#17517)
- feat(config): Add build.profile, install.profile (rust-lang/cargo#17215)
- feat(builtin-deps): Add `SourceKind::Builtin` (rust-lang/cargo#17513)
- fix(compilation): Preventing OUT_DIR env var from leaking into cargo run after build.rs run (rust-lang/cargo#17503)

r? ghost
@rustbot rustbot added this to the 1.101.0 milestone Sep 30, 2026
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Oct 1, 2026
Update cargo submodule

8 commits in 3d7cf6e937d6127d0f49881bf689c560b36d35c4..f3865b2a4d1acc5276f6b3c67d0e057f4dab3928
2026-09-25 01:47:29 +0000 to 2026-09-29 19:58:08 +0000
- fix(config): Proper dotted tuple support with legacy fallback (rust-lang/cargo#17536)
- refactor: Rename internal content from target-triple to target-tuple (rust-lang/cargo#17535)
- docs(changelog): remove duplicate items (rust-lang/cargo#17528)
- chore: bump to 0.102.0; update changelog (rust-lang/cargo#17525)
- feat(metadata): mirror package features in features_v2 (rust-lang/cargo#17517)
- feat(config): Add build.profile, install.profile (rust-lang/cargo#17215)
- feat(builtin-deps): Add `SourceKind::Builtin` (rust-lang/cargo#17513)
- fix(compilation): Preventing OUT_DIR env var from leaking into cargo run after build.rs run (rust-lang/cargo#17503)

r? ghost
epage added a commit to epage/cargo that referenced this pull request Oct 20, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

Fixes rust-lang#15931
epage added a commit to epage/cargo that referenced this pull request Oct 20, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

For cargo `cargo test --no-run` build+target dir:
- master:  3.6G
- this PR: 2.9G

For bevy `cargo test --no-run` build+target dir:
- master:  369G
- this PR: 348G

Surprised at how much space was taken up:
- `build/`: 189G -> 174G
- `examples/`: 175G -> 168G (across 364 examples)
- `incremental/`: 14G -> 8G

Fixes rust-lang#15931
epage added a commit to epage/cargo that referenced this pull request Oct 21, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

For cargo `cargo test --no-run` build+target dir:
- master:  3.6G
- this PR: 2.9G

For bevy `cargo test --no-run` build+target dir:
- master:  369G
- this PR: 348G

Surprised at how much space was taken up:
- `build/`: 189G -> 174G
- `examples/`: 175G -> 168G (across 364 examples)
- `incremental/`: 14G -> 8G

Fixes rust-lang#15931
epage added a commit to epage/cargo that referenced this pull request Oct 21, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

For cargo `cargo test --no-run` build+target dir:
- master:  3.6G
- this PR: 2.9G

For bevy `cargo test --no-run` build+target dir:
- master:  369G
- this PR: 348G

Surprised at how much space was taken up:
- `build/`: 189G -> 174G
- `examples/`: 175G -> 168G (across 364 examples)
- `incremental/`: 14G -> 8G

Fixes rust-lang#15931
epage added a commit to epage/cargo that referenced this pull request Oct 21, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

For cargo `cargo test --no-run` build+target dir:
- master:  3.6G
- this PR: 2.9G

For bevy `cargo test --no-run` build+target dir:
- master:  369G
- this PR: 348G

Surprised at how much space was taken up:
- `build/`: 189G -> 174G
- `examples/`: 175G -> 168G (across 364 examples)
- `incremental/`: 14G -> 8G

Fixes rust-lang#15931
epage added a commit to epage/cargo that referenced this pull request Oct 21, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

For cargo `cargo test --no-run` build+target dir:
- master:  3.6G
- this PR: 2.9G

For bevy `cargo test --no-run` build+target dir:
- master:  369G
- this PR: 348G

Surprised at how much space was taken up:
- `build/`: 189G -> 174G
- `examples/`: 175G -> 168G (across 364 examples)
- `incremental/`: 14G -> 8G

Fixes rust-lang#15931
epage added a commit to epage/cargo that referenced this pull request Oct 28, 2026
With rust-lang#17215 merged, users can set the new `debug` profile as their
default build profile without an MSRV bump and get the same behavior
between previous versions of Cargo and those that include this change.

There is still the possibility of `opt-level` but that is less certain.

For cargo `cargo test --no-run` build+target dir:
- master:  3.6G
- this PR: 2.9G

For bevy `cargo test --no-run` build+target dir:
- master:  369G
- this PR: 348G

Surprised at how much space was taken up:
- `build/`: 189G -> 174G
- `examples/`: 175G -> 168G (across 364 examples)
- `incremental/`: 14G -> 8G

Fixes rust-lang#15931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: Command-line interface, option parsing, etc. A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-profiles Area: profiles Command-clean Command-install Command-test disposition-merge FCP with intent to merge finished-final-comment-period FCP complete S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. T-cargo Team: Cargo to-announce

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants