Skip to content

feat(profile): Add built-in profile debug - #17214

Merged
weihanglo merged 4 commits into
rust-lang:masterfrom
epage:debug-profile
Aug 7, 2026
Merged

feat(profile): Add built-in profile debug #17214
weihanglo merged 4 commits into
rust-lang:masterfrom
epage:debug-profile

Conversation

@epage

@epage epage commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

@rustbot rustbot added the A-cli Area: Command-line interface, option parsing, etc. label Jul 14, 2026
@epage
epage marked this pull request as draft July 14, 2026 20:18
@rustbot rustbot added the A-cli-help Area: built-in command-line help label Jul 14, 2026
@rustbot

rustbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

r? @ehuss

rustbot has assigned @ehuss.
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-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-profiles Area: profiles S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed 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 ready for review July 15, 2026 00:10
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 15, 2026
@rustbot

This comment has been minimized.

@weihanglo

Copy link
Copy Markdown
Member

@epage

epage commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Added the link and what looked like I might have been missing

@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.

I think this is less risky as debug has been a reserved profile for a long while, and people kinda agree on the direction in the meeting this week, so probably don't need an FCP. What do you think?

View changes since this review

@weihanglo weihanglo added the T-cargo Team: Cargo label Jul 17, 2026
@weihanglo

This comment was marked as duplicate.

1 similar comment
@weihanglo

This comment was marked as duplicate.

@rust-rfcbot

This comment was marked as outdated.

@weihanglo

Copy link
Copy Markdown
Member

@rfcbot fcp merge T-cargo

This is a one-way-door decision that debug becomes an actual profile. See the PR description for details.

@rust-rfcbot

rust-rfcbot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

@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.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Jul 17, 2026
@epage

epage commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

While we can pivot, I think an FCP is important as this is setting a direction and can be disruptive to the ecosystem if we pivoted on that direction.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@ehuss ehuss moved this to FCP merge in Cargo status tracker Jul 21, 2026
@rust-rfcbot rust-rfcbot added final-comment-period FCP — a period for last comments before action is taken and removed proposed-final-comment-period An FCP proposal has started, but not yet signed off. labels Jul 28, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@0xPoe 0xPoe 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.

Thanks!
Do we need to update the help text as well?

"Build in debug mode (with the 'dev' profile) instead of release mode",

And do we need to update default_profile_candidates to include the debug profile?

And for build cache docs, as you mentioned it in your PR body, I’m not sure it’s worth mentioning the debug profile in it.

View changes since this review

Comment thread doc/book/src/commands/cargo-test.md Outdated
Comment thread tests/testsuite/profile_custom.rs Outdated
epage added 3 commits July 31, 2026 11:47
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.
@rustbot

rustbot commented Jul 31, 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.

@rust-rfcbot rust-rfcbot added finished-final-comment-period FCP complete and removed final-comment-period FCP — a period for last comments before action is taken labels Aug 7, 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.

@weihanglo

Copy link
Copy Markdown
Member

Let's merge it. We have lots of things today!

@weihanglo
weihanglo added this pull request to the merge queue Aug 7, 2026
Merged via the queue into rust-lang:master with commit b07e5a0 Aug 7, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 7, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Aug 8, 2026
Update cargo submodule

14 commits in c79e8f89441b3e73d6d65d125c0c745792808c74..b07e5a08651da80108eb65d7dc769ee04589f9bf
2026-08-04 19:17:33 +0000 to 2026-08-07 21:51:16 +0000
- feat(profile): Add built-in profile debug  (rust-lang/cargo#17214)
- feat(toml): allow overriding inherited default-features in 2024 (rust-lang/cargo#17126)
- feat(resolver): Report the min-publish-age in the lock message (rust-lang/cargo#17328)
- refactor(resolver): resolve() does not need an optional gctx (rust-lang/cargo#17331)
- fix(resolver): Make min-publish-age relative to --publish-time  (rust-lang/cargo#17327)
- test(trim-paths): exercise unremap files with debuggers (rust-lang/cargo#17326)
- feat(log): emit build-started JSON message with run_id  (rust-lang/cargo#16632)
- docs: remove stray `directory` metavar from `cargo update --breaking` option (rust-lang/cargo#17319)
- fix(lock): Use more accurate 'highest, rather than 'latest' (rust-lang/cargo#17317)
- docs(changelog): Pull the --verbose item (rust-lang/cargo#17315)
- revert(compiler): forward verbose flag to rustc for local crates (rust-lang/cargo#17314)
- fix(diag): Gate blanket_hint_mostly_unused with -Zprofile-hint-mostly-unused (rust-lang/cargo#17313)
- fix(diag): Remove complexity, perf, and nursery lint groups (rust-lang/cargo#17307)
- fix(git): Avoid use of git's core.fsmonitor (rust-lang/cargo#17306)

r? ghost
@rustbot rustbot added this to the 1.99.0 milestone Aug 8, 2026
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Aug 9, 2026
Update cargo submodule

14 commits in c79e8f89441b3e73d6d65d125c0c745792808c74..b07e5a08651da80108eb65d7dc769ee04589f9bf
2026-08-04 19:17:33 +0000 to 2026-08-07 21:51:16 +0000
- feat(profile): Add built-in profile debug  (rust-lang/cargo#17214)
- feat(toml): allow overriding inherited default-features in 2024 (rust-lang/cargo#17126)
- feat(resolver): Report the min-publish-age in the lock message (rust-lang/cargo#17328)
- refactor(resolver): resolve() does not need an optional gctx (rust-lang/cargo#17331)
- fix(resolver): Make min-publish-age relative to --publish-time  (rust-lang/cargo#17327)
- test(trim-paths): exercise unremap files with debuggers (rust-lang/cargo#17326)
- feat(log): emit build-started JSON message with run_id  (rust-lang/cargo#16632)
- docs: remove stray `directory` metavar from `cargo update --breaking` option (rust-lang/cargo#17319)
- fix(lock): Use more accurate 'highest, rather than 'latest' (rust-lang/cargo#17317)
- docs(changelog): Pull the --verbose item (rust-lang/cargo#17315)
- revert(compiler): forward verbose flag to rustc for local crates (rust-lang/cargo#17314)
- fix(diag): Gate blanket_hint_mostly_unused with -Zprofile-hint-mostly-unused (rust-lang/cargo#17313)
- fix(diag): Remove complexity, perf, and nursery lint groups (rust-lang/cargo#17307)
- fix(git): Avoid use of git's core.fsmonitor (rust-lang/cargo#17306)

r? ghost
@epage
epage deleted the debug-profile branch August 10, 2026 17:06
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-install disposition-merge FCP with intent to merge finished-final-comment-period FCP complete T-cargo Team: Cargo to-announce

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants