rust icon indicating copy to clipboard operation
rust copied to clipboard

Package debug libstd with binaries

Open brson opened this issue 10 years ago • 6 comments

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.

brson avatar Jan 06 '15 11:01 brson

There are some options: we could just provide separate debuginfo for the optimized std, but we could also provide an unoptimized std with debuginfo.

brson avatar Jan 06 '15 11:01 brson

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!

alexcrichton avatar Jan 08 '15 23:01 alexcrichton

Still something we want to do.

brson avatar Oct 18 '15 17:10 brson

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.

retep998 avatar Mar 27 '16 06:03 retep998

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.

steveklabnik avatar Dec 10 '18 18:12 steveklabnik

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-std option to cargo as 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 libstd itself?

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.

pnkfelix avatar Oct 17 '22 14:10 pnkfelix

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.

jyn514 avatar Feb 03 '23 08:02 jyn514