Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Do not strip debuginfo by default for MSVC #13630

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Mar 23, 2024

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 in rustc, 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 the rustc side.

Related issue: rust-lang/rust#122857

@rustbot
Copy link
Collaborator

rustbot commented Mar 23, 2024

r? @epage

rustbot has assigned @epage.
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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2024
Copy link
Member

@weihanglo weihanglo left a 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.

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 23, 2024

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 master, and only then be backported into stable.

@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2024

Is this intended to be temporary? It's hard to follow from rust-lang/rust#122857 if this is actually an issue in rustc.

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 23, 2024

I modified the PR description to add more context.

@workingjubilee
Copy link
Member

Is this intended to be temporary? It's hard to follow from rust-lang/rust#122857 if this is actually an issue in rustc.

This is an overeager cargo behavior that, when combined with an inconsistent rustc behavior, leads to compounded incorrectness.

@workingjubilee
Copy link
Member

workingjubilee commented Mar 23, 2024

To be clear, it is my opinion, speaking mostly from my (brief) tenure as backtrace-rs maint:

  • Kobzol's implementation for cargo should have been fine.
  • rustc's behavior verges on simply incoherent, currently.
  • sorting the rustc fix out will likely take more than a week or two.
  • I can't realistically test release-build backtrace-rs on Windows nightly or beta right now because Windows release-build backtraces are effectively dead on nightly so whatever workaround I use won't reflect anything anyone except a scant handful of rustc/cargo devs know to do.
  • therefore, because the cargo + rustc behaviors lead to absurd incorrectness when combined, one should be walked back so that the current nightly/beta can be tested for a reasonable amount of time, and we already established the rustc fix isn't landing tomorrow or even by Wednesday.

@Kobzol Kobzol force-pushed the msvc-disable-release-strip branch from de87e7c to ab285e9 Compare March 24, 2024 08:39
@Kobzol Kobzol force-pushed the msvc-disable-release-strip branch from 647dbab to 53a0dc4 Compare March 25, 2024 22:42
@weihanglo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Mar 26, 2024

📌 Commit 53a0dc4 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 26, 2024
@bors
Copy link
Contributor

bors commented Mar 26, 2024

⌛ Testing commit 53a0dc4 with merge fa619a9...

@weihanglo weihanglo added the beta-nominated Nominated to backport to the beta branch. label Mar 26, 2024
@bors
Copy link
Contributor

bors commented Mar 26, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing fa619a9 to master...

@bors bors merged commit fa619a9 into rust-lang:master Mar 26, 2024
21 checks passed
@Kobzol Kobzol deleted the msvc-disable-release-strip branch March 26, 2024 06:34
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 26, 2024
…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
@rustbot rustbot added this to the 1.79.0 milestone Mar 26, 2024
bors added a commit that referenced this pull request Mar 26, 2024
[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:

-
bors added a commit that referenced this pull request Mar 26, 2024
[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:

-
taiki-e referenced this pull request in nextest-rs/nextest Mar 27, 2024
Restore behavior changed in 4e259a7, because
it turns out that `strip = "debuginfo"` still strips too much.

This was observed with the cargo-nextest 0.9.68-rc.1 binary on illumos, where
`pstack` showed lots of ??? marks.

Part of #1345.
weihanglo added a commit to weihanglo/cargo that referenced this pull request Jun 13, 2024
…trip, r=weihanglo"

This reverts commit fa619a9, reversing
changes made to 1f6857d.

See also <rust-lang/rust#115120>
bors added a commit that referenced this pull request Jun 13, 2024
Revert #13630 as rustc ignores `-C strip` on MSVC

This reverts commit fa619a9, reversing changes made to 1f6857d.

See also <rust-lang/rust#115120>.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2024
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
@rustbot rustbot modified the milestones: 1.79.0, 1.81.0 Jun 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beta-nominated Nominated to backport to the beta branch. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants