getsolus / ferryd

Fast, safe and reliable transit for the delivery of software updates to users.
https://getsol.us
Apache License 2.0
15 stars 5 forks source link

Extract *-dbginfo subpackages to debuginfod folder #25

Open joebonrichie opened 6 months ago

joebonrichie commented 6 months ago

For any new packages matching the -dbginfo.eopkg glob unzip and extract the .debug files to a configurable debuginfod folder.

When a debuginfod service is running this should be enough to get that working.

Justinzobel commented 3 months ago

I have set it up temporarily and it's ready to test. I can confirm by symbols existing and the download logs from the server that it's pulling the debug files.

Test procedure:

  1. In a terminal run sleep 60
  2. While that is running, in another terminal find the PID of that sleep process and do kill -QUIT $PID
  3. Then do: export DEBUGINFOD_URLS=http://shared.getsol.us:8002/;coredumpctl gdb $PID
Justinzobel commented 3 months ago

With an added note, we'll need to set up a system to keep the debug symbol files cleaned up when packages are removed from the repository.

My first though:

Ferryd does the extraction of the debug files into the folder:

# Extract eopkg
unzip -p *.eopkg install.tar.xz > install.tar.xz
# Extract data tarball
tar xf install.tar.xz
# Move *.debug to current directory
find usr -name "*.debug" -print0 | xargs -0 -I {} mv {} .
# Cleanup
rm -rf install.tar.xz usr/ *.eopkg

During this process it notes down all the *.debug files and assigns them to a package, it could be just a text file in the same directory that is called nano-5-1-dbginfo.eopkg and lists a.debug b.debug etc, or an sqlite database with fields of pkg and debugfiles and debugfiles is just a list of the filenames.

Then whatever tool is used to trim the repository of excess files also jumps into the debug symbols directory, and if xyz-dbginfo package is removed, it checks for a xyz-dbginfo file there, removes the filenames listed in it and then the file itself.