Bugzilla – Bug 1184257
hardcode knowledge about https://debuginfod.opensuse.org/ in debuginfod client
Last modified: 2021-04-29 13:19:18 UTC
[ Mentioned here ( https://sourceware.org/bugzilla/show_bug.cgi?id=27667#c17 ). ] The debuginfod client could handle source request to https://debuginfod.opensuse.org/ more efficiently by hardcoding the knowledge that all files served by https://debuginfod.opensuse.org/ start with /usr/src/debug/.
I wrote the following script to verify the assumption: ... #!/bin/sh packages=$(zypper packages | grep debugsource | sed 's/[^|]*|//' | awk '{print $3}') for p in $packages; do sudo zypper install -y --download-only $p 1>&2 rpm=$(find /var/cache/zypp -iname $p*rpm) n=$(echo $rpm | wc -w) if [ $n -ne 1 ]; then echo "Did not find single rpm: \"$rpm\"" > /dev/stderr continue fi rpm -qlp $rpm done ... It generates a list of all the source files in all the source packages. I ran it for quite a bit, and only /usr/src/debug files were found.
Good point, I can confirm that using [1]: $ ./obs-download-rpms.py https://api.opensuse.org openSUSE:Factory:Staging:A ~/BIG/A $ find . -name '*debugsource*' | wc -l 1834 $ find . -name '*debugsource*' | xargs rpm -qpl | grep -v '/usr/src/debug' (contains no files) $ find . -name '*debugsource*' | xargs rpm -qpl | grep '/usr/src/debug' | wc -l 550850 I'm also thinking about adding a patch to rpm package where we can add assert that all debugsource files live in /usr/src/debug. What do you think? [1] https://github.com/marxin/script-misc/blob/master/obs-download-rpms.py
(In reply to Martin Liška from comment #2) > I'm also thinking about adding a patch to rpm package where we can add > assert that all debugsource files live in /usr/src/debug. > What do you think? I'm not sure. The assert would be valid for any package build using rpm, while the assumption we make only needs to hold for packages exported via the debuginfod url.
(In reply to Tom de Vries from comment #3) > (In reply to Martin Liška from comment #2) > > I'm also thinking about adding a patch to rpm package where we can add > > assert that all debugsource files live in /usr/src/debug. > > What do you think? > > I'm not sure. > > The assert would be valid for any package build using rpm, while the > assumption we make only needs to hold for packages exported via the > debuginfod url. All right. Am I correct that a proper upstream is something like: https://sourceware.org/bugzilla/show_bug.cgi?id=27673 and the openSUSE knowledge that source files live in /usr/src/debug/ is a hint for now?
(In reply to Martin Liška from comment #4) > (In reply to Tom de Vries from comment #3) > > (In reply to Martin Liška from comment #2) > > > I'm also thinking about adding a patch to rpm package where we can add > > > assert that all debugsource files live in /usr/src/debug. > > > What do you think? > > > > I'm not sure. > > > > The assert would be valid for any package build using rpm, while the > > assumption we make only needs to hold for packages exported via the > > debuginfod url. > > All right. Am I correct that a proper upstream is something like: > https://sourceware.org/bugzilla/show_bug.cgi?id=27673 > > and the openSUSE knowledge that source files live in /usr/src/debug/ is a > hint for now? Agreed.