Skip to content
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

Run a debuginfod server #522

Open
geofft opened this issue Feb 11, 2025 · 3 comments
Open

Run a debuginfod server #522

geofft opened this issue Feb 11, 2025 · 3 comments

Comments

@geofft
Copy link
Collaborator

geofft commented Feb 11, 2025

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/<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.

@zanieb
Copy link
Member

zanieb commented Feb 11, 2025

We "append" to a GitHub Pages deployment over in https://github.com/astral-sh/packse/tree/gh-pages and that's fine / simple.

I don't know if it's worth seeding previous builds, but it's hard to say. We could detect the case in uv and instruct them to upgrade for debug symbols. Or, we could just use the actual debug build for those versions (since it's already available). I definitely would start with just populating the latest versions on release.

If we have a debug symbol server, I wonder if we could stop publishing the debug builds.

@geofft
Copy link
Collaborator Author

geofft commented Feb 11, 2025

Oh, right, we can just push to a gh-pages branch instead of using the deployment mechanism, sure.

@willnewton
Copy link

This sounds perfect for my use case, thanks for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants