-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not strip debuginfo by default for MSVC #13630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is intended to be a stable backport, you need to file a PR against rust-1.77.0
branch.
This should also be fixed/changed in nightly, I'm not sure if a different fix will appear that soon. So I thought that this should first go into |
Is this intended to be temporary? It's hard to follow from rust-lang/rust#122857 if this is actually an issue in rustc. |
I modified the PR description to add more context. |
This is an overeager cargo behavior that, when combined with an inconsistent rustc behavior, leads to compounded incorrectness. |
To be clear, it is my opinion, speaking mostly from my (brief) tenure as backtrace-rs maint:
|
de87e7c
to
ab285e9
Compare
647dbab
to
53a0dc4
Compare
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
…rkingjubilee Update cargo 5 commits in a510712d05c6c98f987af24dd73cdfafee8922e6..499a61ce7a0fc6a72040084862a68b2603e770e8 2024-03-25 03:45:54 +0000 to 2024-03-26 04:17:04 +0000 - fix: do not borrow shell across registry query (rust-lang/cargo#13647) - Do not strip debuginfo by default for MSVC (rust-lang/cargo#13630) - chore(deps): update msrv (rust-lang/cargo#13577) - Fix doc collision for lib/bin with a dash in the inferred name. (rust-lang/cargo#13640) - refactor: Make lint names snake_case (rust-lang/cargo#13635) r? ghost
[stable-1.77] Do not strip debuginfo by default for MSVC Stable backports: - #13630 In order to make CI pass, the following PRs are also cherry-picked: -
[beta-1.78] Do not strip debuginfo by default for MSVC Beta backports: - #13630 In order to make CI pass, the following PRs are also cherry-picked: -
…trip, r=weihanglo" This reverts commit fa619a9, reversing changes made to 1f6857d. See also <rust-lang/rust#115120>
Revert #13630 as rustc ignores `-C strip` on MSVC This reverts commit fa619a9, reversing changes made to 1f6857d. See also <rust-lang/rust#115120>.
Update cargo 13 commits in 4dcbca118ab7f9ffac4728004c983754bc6a04ff..a1f47ec3f7cd076986f1bfcd7061f2e8cb1a726e 2024-06-11 16:27:02 +0000 to 2024-06-15 01:10:07 +0000 - Change verification order during packaging. (rust-lang/cargo#14074) - Update git2 for libgit2 1.8.1 (rust-lang/cargo#14067) - Fix some documentation misspellings (rust-lang/cargo#14066) - chore(deps): update msrv (1 version) to v1.79 (rust-lang/cargo#14063) - test: Redact conditional compile-fail warning (rust-lang/cargo#14064) - Migrate a few test files to snapbox (rust-lang/cargo#14048) - docs(contrib): Improve triage instructions (rust-lang/cargo#14052) - chore(ci): Upgrade cargo-semver-checks (rust-lang/cargo#14062) - Revert rust-lang/cargo#13630 as rustc ignores `-C strip` on MSVC (rust-lang/cargo#14061) - test: migrate features_are_quoted to snapbox (rust-lang/cargo#14051) - Add assert redactions (rust-lang/cargo#14054) - test: migrate build_script_env to snapbox (rust-lang/cargo#14044) - docs: Iterate on --breaking docs (rust-lang/cargo#14047) r? ghost
This PR disables the logic which enables debuginfo stripping by default in release mode (#13257) for MSVC, since it causes problems there (rust-lang/rust#122857).
I'm not sure if this is the correct way to gate the logic on a specific target triple.
The root of the issue is that
-Cstrip=debuginfo
currently behaves like-Cstrip=symbols
on MSVC, which causes the original optimization to break backtraces on Windows. Ultimately, this should probably be fixed inrustc
, but that might take some further design work, therefore a faster solution would be to just special case this in Cargo for now, and remove the special case later, once it gets fixed on therustc
side.Related issue: rust-lang/rust#122857