axodotdev / axodotdev/cargo-dist

Splitting Debuginfo

Open
#30 5 comments 0 reactions 0 assignees View on GitHub
feature request help wanted
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

Another future killer app: properly setting the flags and running the tools to produce proper symbol/debuginfo files (similar to source maps, but for native code).

[This comment covers a lot of useful details on the state of this stuff in rust](https://github.com/rust-lang/rust/pull/98051#issuecomment-1153776677).

Some quick notes:

Each platform has different formats for this:
* windows pdb
* apple dsym
* linux dwp / [linux "strip"](https://github.com/rust-lang/compiler-team/issues/721)
* breakpad (platform-agnostic) [sym](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md)

Different platforms have different symbol servers:
* [windows symbol server](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/microsoft-public-symbols) (can fetch exe/dll/pdb)
* breakpad generalizes this for .sym, see mozilla's [tecken](https://tecken.readthedocs.io/en/latest/)
* [linux debuginfod](https://sourceware.org/elfutils/Debuginfod.html)
* apple: just ask xcode lolsob
* android: suck eggs

To generate symbol files for rust you want to:

* build a release binary
* with opt-level=3 or w/e release is
* with codegen-units=1
* with LTO..?
* with debug info cranked to max
* build with debug=2
* enable split-debuginfo which is [horribly platform specific](https://github.com/rust-lang/rust/pull/98051#issuecomment-1153776677)
* if targetting breakpad: run [dump_syms](https://github.com/mozilla/dump_syms) to get a .sym
* strip the binary?

Then the user will want to:

* grab the final debuginfo/symbol file
* get the unique build ids that map the debuginfo to the binary (platform-specific, hopefully embedded in the file, but we should still get them out?)
* upload it to a symbol server?
* package it?

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked Rust pull request and the platform-specific notes for Windows PDBs, Apple dSYM, Linux debuginfo, and Breakpad .sym files. Review how dump_syms generates symbol files and compare the listed build, build-ID, upload, and packaging requirements. Done would require a decided cross-platform scope and an implementation plan for producing and handling these artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, release
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.