-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Replace libbacktrace with a native Rust library #46439
Comments
Note that I don't think this is quite right in the sense that, despite the name, we don't actually use libbacktrace for unwinding. Instead we primarily use it for symbolication of a backtrace (mapping from an address to symbol name, file name, line number, etc). We also have an unwinder but that comes from a variety of sources and is often way trickier to get right on all the platforms. A good incremental first step would be indeed to replace libbacktrace, but probably with something like addr2line instead of for unwinding functionality. |
Updated the title to be more general. |
Hmm so I've tried including
Now it seems to me like that this problem is worked around for currently present crates by adding shims for them in @alexcrichton what do you think we should do here? Can this be fixed by an unstable feature in cargo that we enable in libstd's Cargo.toml? |
@est31, FYI Alex is AFK for the next month to month and a half or so. |
@fitzgen thanks for pointing this out. I'm right now in contact with @Mark-Simulacrum about ways to fix the issue. Turns out that they already have a draft version of a cargo change lying around that's very similar to the one I had in mind. I only need to rebase it. |
So I've taken @Mark-Simulacrum 's patch for cargo ( https://github.com/Mark-Simulacrum/cargo/tree/implicit-deps ) and rebased it and changed it to use env vars. And I also changed bootstrap to generate such an env var during build (without using most of @Mark-Simulacrum 's patch on that). Then I discovered that now every single invocation of cargo that goes not through Changing the feature to be cargo-centric like enabling it via directives in @Mark-Simulacrum suggested that the easiest fix would be to run sth like |
Nowadays we have infrastructure to make libstd depend on crates.io, and that is working fine -- seems to me that should help with some of the issues that came up here earlier. |
@RalfJung maybe some additional work has happened since #56092, but if it reflects the most recent state of affairs, then you need to add inclusion-into-std-special invocations to the For something like the backtrace crate which has few rust-based dependencies, this is quite easy, but this is the recursive dependency tree of the addr2line crate as of latest git commit:
It would require quite many PRs to add that special text to all those crates. Any additional crates they rely on in future versions would need that text, too. Instead, I suggest that someone revives my PR #51440. It only requires |
Ouch. :( Yes, that would still be quite painful today. |
See also rust-lang/backtrace-rs#189 |
This was implemented in #74682, so I believe this issue can be closed. |
One of our last remaining C dependencies is libbacktrace. unwind-rs, from the gimli project, looks to be a promising replacement: https://github.com/gimli-rs/unwind-rs . Evaluate its suitability and continue the inexorable oxidation of the compiler.
The text was updated successfully, but these errors were encountered: