astral-sh / astral-sh/python-build-standalone
Run a debuginfod server
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 314
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Description
Recent versions of gdb and other tools support loading debuginfo as needed from a web server. See https://sourceware.org/elfutils/Debuginfod.html and in particular the man pages linked under "more readings" at the bottom for a rough description of the protocol. While there is an official `debuginfod` server, the protocol is relatively straightforward and can be sufficiently implemented with a static host (like GitHub Pages). The main thing is to respond to `GET /buildid//debuginfo` with either a separated ELF file with just debuginfo or the original unstripped binary. You can get the build ID from `readelf -n` (there is probably some better way to do it that is escaping me at the moment).
Given a binary from the install-only stripped distribution as installed by uv, you can run gdb with `DEBUGINFOD_URLS` set, e.g.
```DEBUGINFOD_URLS=http://192.168.64.1:8000 gdb ~/.local/share/uv/python/cpython-3.12.8-linux-aarch64-gnu/bin/python```
and `python -m http.server` will show this log line:
```
::ffff:192.168.64.93 - - [11/Feb/2025 15:30:05] "GET /buildid/cbbda983d26fd147214aec679919f111466483c4/debuginfo HTTP/1.1" 200 -
```
and gdb will find symbols.
It'd be nice to have debuginfo for all our releases, or at least relatively recent ones, as opposed to just the last release, since uv does not particularly eagerly upgrade python-build-standalone. So we can't quite take the approach of running something into the release workflow to upload to GitHub Pages, because each of those deployments is a brand new website from scratch. We can maybe
* have the release workflow download the current GitHub Pages deployment, add to it, and upload (and seed the base case manually, maybe)
* have a separate workflow to download all our recent releases, construct the whole static site, and upload it
* use something other than GitHub Pages where uploads are additive, like S3
And then do the appropriate DNS config and tell people to set `DEBUGINFOD_URLS=https://debuginfod.astral.sh` or something.
See also astral-sh/uv#11387.
Contributor guide
Assessment
This issue has not been assessed yet.