Skip to content
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

Document variance in strip #13677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

workingjubilee
Copy link

Two variances in strip will remain, even after MSVC shenanigans settle:

  • Its default based on profile.
  • That it can sometimes make backtraces nonsensical.

In my experience, people will complain to me if backtraces are fucked up, but sometimes it was their own decision to make the backtrace really bad. Inform them of this. Hopefully this also encourages people to report if their backtraces regress in some platform-dependent way without enabling strip = "symbols", which we would want to know about.

Two variances in strip will remain, even after MSVC shenanigans settle:
- Its default based on profile.
- That it can sometimes make backtraces nonsensical.

In my experience, people will complain to me if backtraces are fucked up,
but sometimes it was their own decision to make the backtrace really bad.
Inform them of this. Hopefully this also encourages people to report if
their backtraces regress in some platform-dependent way without enabling
`strip = "symbols"`, which we would want to know about.
@rustbot
Copy link
Collaborator

rustbot commented Apr 1, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @epage (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 1, 2024
@@ -117,7 +117,9 @@ strip = "debuginfo"
```

Possible string values of `strip` are `"none"`, `"debuginfo"`, and `"symbols"`.
The default is `"none"`.
The default is `"none"` by default, and `"debuginfo"` in release profile.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to #13638, I don't think this is entirely correct. The default strip behavior depends on if debug is set (including overrides).

In #13257, we somewhat intentionally did not document this, as it should be a completely internal matter that should be transparent to the user. It is only running strip to deal with the particular way the standard library is distributed.

I'm not yet entirely convinced this should be documented, since it is a relatively complicated thing to explain to the user (something they shouldn't even need to know about) which could just contribute to confusion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...Frankly, I don't know why there are even two options if one affects how the other is interpreted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, I do not believe these behaviors are actually completely internal matters that are transparent to the user, as the effective behavior seems to change wildly based on the target, host, or available binaries, e.g.

Perhaps we can make it one with rust-lang/rust#123151 but it isn't now.

Comment on lines +121 to +122
Be aware that stripping `"symbols"` may make backtraces incomprehensible,
depending on the platform.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part, the cargo documentation doesn't dive into the particulars of explaining the different options and their consequences. That documentation should generally live in the rustc book (so we don't have to duplicate it in two remote places). Adding warnings about the consequences of stripping symbols would probably be appropriate over there (and seems good to include).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is my experience that people often do not actually click through, simply put.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants