Bug 1583329

Summary: rpmbuild: Empty %files file debugsourcefiles.list
Product: [Fedora] Fedora Reporter: Miroslav Suchý <msuchy>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: ignatenko, mjw, packaging-team-maint, pmatilai, pmoravco, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-30 08:20:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Suchý 2018-05-28 17:57:14 UTC
Description of problem:
I am getting from and rpmbuild:

Processing files: cello-debugsource-1.0-1.fc28.x86_64
error: Empty %files file /home/christian/rpmbuild/BUILD/cello-1.0/debugsourcefiles.list

For more info and files for reproducer see
https://github.com/redhat-developer/rpm-packaging-guide/issues/47

I tried and reproduced this on recent Fedora28.

Version-Release number of selected component (if applicable):
rpm-build-4.14.1-9.fc28.x86_64

How reproducible:
always

Steps to Reproduce:
1. build package cello.src.rpm as documented in packaging guide
2. try to rebuild it (to get a binary package).

Comment 1 Mark Wielaard 2018-05-28 18:47:17 UTC
You are not building any debuginfo:

gcc -o cello cello.c

Try the following:

gcc -g -o cello cello.c

Otherwise it will be impossible for rpmbuild to determine the debug source files and debuginfo files to package.

Comment 2 Miroslav Suchý 2018-05-30 08:20:55 UTC
Indeed. I will fix the guide. Thank you.

Comment 3 Panu Matilainen 2018-05-30 08:36:15 UTC
Just makes me wonder if we couldn't do a better job at reporting the *actual* problem especially now that much of the build-id extraction occurs inside rpmbuild code...

Comment 4 Mark Wielaard 2018-05-30 08:55:15 UTC
(In reply to Panu Matilainen from comment #3)
> Just makes me wonder if we couldn't do a better job at reporting the
> *actual* problem especially now that much of the build-id extraction occurs
> inside rpmbuild code...

The build-ids match executable builds and debuginfo files, the builds would still have build-ids. This particlar error occurs earlier because no source files can be found at all.

There is however a test in find-debuginfo.sh that checks for case:

if [ -s "$SOURCEFILE" ]; then
...
fi

We might want to add an else with a warning there?