rust
rust copied to clipboard
Package debug libstd with binaries
For debugging it's useful to have a debug build of std. Figuring out how to make the debugger actually locate the source in all scenarios could be complicated.
There are some options: we could just provide separate debuginfo for the optimized std, but we could also provide an unoptimized std with debuginfo.
I would personally be very worried about binary distribution size if we distribute yet another set of copies of the standard library, but the idea here sounds great!
Still something we want to do.
I'd very much like an optional package that bundles .pdb debug info for the exe and dll binaries in the nightlies. Sometimes I want to debug what rustc is doing or profile it, and I can't really do it unless I build rustc from source.
Triage: no changes here. I wonder if we'll do this, or if we'll eventually get to "cargo aware std", where you can get your own debug build when building your project.
Visiting for wg-debugging triage
Some questions that we had while thinking about this:
- What does a debuggable libstd mean? As brson wrote above: It could mean a libstd built in developer mode (which means debug_asserts enabled, and maybe also optimizations turned off). or it might just mean packaging the associated debuginfo for libstd.
- In practice today, pnkfelix thinks the people who want to do this kind of deep dive into libstd itself are building their own Rust distribution. In theory, a
-Zbuild-stdoption tocargoas alluded to by steveklabnik above would also provide that level of introspection into libstd (without requiring the same amount of effort as rebuilding the whole distribution).- So, the question: If we had working
-Zbuild-std, are there people who would still want the project to distribute a debuggable libstd separately? - If so, is it solely because of the cost of doing the local build of
libstditself?
- So, the question: If we had working
It seems like a very open question about whether we would do this at all at this point, and if we did, I suspect it would need to be driven by an RFC. Especially since, from our point of view, it is hard for the members of wg-debugging to understand the scenario where someone "wants to debug std but not as part of working on std"; we imagine that the best way to debug libstd is to make your own local build of rust. (If the real motivation here is "it is too costly to do a local build", then I can understand that. but I want to make sure that is indeed the key motivation.)
Anyway, as implied by the previous paragraph, I am currently thinking that we may want to close this issue, with the statement "If you want to propose this, please file an RFC." But I want to give other people the chance to weigh in, especially members of T-infra.
Given the work on split-debuginfo, would it be possible to package the debuginfo in a separate file? That would avoid having to ship a second copy of the standard library.