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

std::backtrace compatibility #600

Open
pjenvey opened this issue Jul 20, 2023 · 4 comments
Open

std::backtrace compatibility #600

pjenvey opened this issue Jul 20, 2023 · 4 comments

Comments

@pjenvey
Copy link

pjenvey commented Jul 20, 2023

Rust as of 1.65.0 (released in 2022-11) now ships with a Backtrace in std. sentry-backtrace should support its usage by providing another backtrace_to_stacktrace function that accepts a std::backtrace::Backtrace instead of backtrace::Backtrace.

@pjenvey
Copy link
Author

pjenvey commented Jul 20, 2023

It looks like one potential option for using the new std Backtrace would be to render it via e.g. format!("{:#?}", backtrace) and passing that to parse_stacktrace. Its own backtrace_to_stacktrace impl would be more efficient though.

@Swatinem
Copy link
Member

As you mentioned, the only thing you can do with std::backtrace::Backtrace right now is Debug-format it, so I doubt it would be useful to have a separate function for it right now.

It might make sense to even completely replace the current usage of backtrace::Backtrace once the std variant is on par with it, and possibly the wider ecosystem would also move to the std variant as well, like the anyhow integration, etc.

@pjenvey
Copy link
Author

pjenvey commented Jul 21, 2023

I hadn't noticed Backtrace::frames has not stabilized yet, thanks. Agreed that that is a blocker for this.

@Swatinem
Copy link
Member

Not only is Backtrace::frames not stabilized yet, it is also pretty useless in its current form, as the only thing you can do with it is Debug-format it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants