Skip to content

fix(profile): preserve inherited strip settings in overrides - #17677

Closed
weihanglo wants to merge 2 commits into
rust-lang:masterfrom
weihanglo:fix-inherited-strip
Closed

weihanglo wants to merge 2 commits into
rust-lang:masterfrom
weihanglo:fix-inherited-strip

Conversation

@weihanglo

@weihanglo weihanglo commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

No description provided.

Record current behavior when build overrides or wildcard and named package overrides omit strip. Release builds expose the inherited-setting reset without changing debuginfo weakening or implicit stripping.

Also verify that an explicit package strip setting still overrides the base profile.
Applying a build or package override that omits strip currently resets an explicit inherited value to Deferred(None). This can enable implicit debuginfo stripping despite strip=false, or replace strip="symbols" with strip="debuginfo".

Keep the inherited value when strip is omitted, matching the documented per-setting precedence. Explicit strip settings in more specific overrides continue to take precedence.

The reset dates to 0608fcd (boolean strip support); the original strip implementation preserved omitted settings. The implicit-stripping proposal in rust-lang#13257 also limits the optimization to cases without an explicit strip setting.

Update the baseline snapshots to show the behavior change for build, wildcard, and named package overrides. Verify explicit package opt-outs continue to override the base profile.
@rustbot rustbot added the A-profiles Area: profiles label Nov 2, 2026
@weihanglo weihanglo closed this Nov 2, 2026
@weihanglo

Copy link
Copy Markdown
Member Author

Sorry for the noise, I am experimenting different stuff and it opened a PR…

@weihanglo
weihanglo deleted the fix-inherited-strip branch November 2, 2026 19:34
Muscraft added a commit to Muscraft/cargo that referenced this pull request Nov 5, 2026
### What does this PR try to resolve?

Profile override wasn't respected for the `strip` option.

The changed was introduced in rust-lang/cargo@0608fcd99d (1.52),
and the smarter stripping also failed to notice the bug
(rust-lang/cargo@58da1cec19a, 1.77).

After this PR, overridding the `strip` profile option is respected.

### Notes to reviewers

I believe this was an oversight as nobody really override the `strip`
option,
though I could be wrong.

---

🤖 LLM involvement: This was pointed out during Codex reviewing my other
experiments. I was really mad that they submitted a PR without my
consent: <rust-lang#17677>. Tests are
anyway generated. Change is one-line change. I deleted and typed it
manually so counted as hand-written? (of course I tweaked the test a bit
and wrote my own description)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-profiles Area: profiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants