Bug 1184257 - hardcode knowledge about https://debuginfod.opensuse.org/ in debuginfod client
Summary: hardcode knowledge about https://debuginfod.opensuse.org/ in debuginfod client
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Lubos Kocman
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-01 06:20 UTC by Tom de Vries
Modified: 2021-04-29 13:19 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2021-04-01 06:20:24 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/.
Comment 1 Tom de Vries 2021-04-01 06:51:31 UTC
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.
Comment 2 Martin Liška 2021-04-01 07:39:15 UTC
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
Comment 3 Tom de Vries 2021-04-06 09:37:00 UTC
(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.
Comment 4 Martin Liška 2021-04-08 11:26:17 UTC
(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?
Comment 5 Tom de Vries 2021-04-08 11:30:17 UTC
(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.