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: -
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