Subject: Empty %files file debugsourcefiles.list

From: Marcin Cieslak <[email-masked]>
Date: Sat, 19 Apr 2025 21:31:33 +0000

Hello,

I try to rebuild some of the packages from the repo
and it looks like "make rpm17" in the directories:

rpm/redhat/17/postgresql-17/F-41 (tried on Fedora 41)
rpm/redhat/17/postgresql-17/F-42 (tried on Fedora 42)

fails with:

Processing files: postgresql17-debugsource-17.4-4PGDG.f42.x86_64
error: Empty %files file /home/saper/src/pgrpms/rpm/redhat/17/postgresql-17/F-42/postgresql17-17.4-build/postgresql-17.4/debugsourcefiles.list

RPM build errors:
     Empty %files file /home/saper/src/pgrpms/rpm/redhat/17/postgresql-17/F-42/postgresql17-17.4-build/postgresql-17.4/debugsourcefiles.list
make: *** [../../../../global/Makefile.global-PG17:104: nopreprpm17] Error 1

In fact, most of the lists that probably should contain some information
are empty:

$ find . -name '[de][el]*.list' -ls
  27653980      0 -rw-r--r--   1 saper    saper           0 Apr 19 17:13 ./postgresql17-17.4-build/postgresql-17.4/debugsources.list
  27653981     12 -rw-r--r--   1 saper    saper       10347 Apr 19 17:13 ./postgresql17-17.4-build/postgresql-17.4/debugfiles.list
  27653982      0 -rw-r--r--   1 saper    saper           0 Apr 19 17:12 ./postgresql17-17.4-build/postgresql-17.4/debuglinks.list
  27653983      8 -rw-r--r--   1 saper    saper        4577 Apr 19 17:13 ./postgresql17-17.4-build/postgresql-17.4/elfbins.list
  27726846      0 -rw-r--r--   1 saper    saper           0 Apr 19 17:13 ./postgresql17-17.4-build/postgresql-17.4/debugsourcefiles.list

I have stepped through the execution of /usr/bin/find-debug-info
and it seems that at the moment it tries to extract the information
from the binaries they are stripped already.

Fedora 42 is a brand new VM with lots of dependencies need to build
our stuff added.  I have reproduced the effect on a laptop running
a pretty minimal Fedora 41.

I have managed to build libpq with the following patch, so not everything
is broken:

diff --git a/rpm/redhat/main/common/libfq/main/libfq.spec b/rpm/redhat/main/common/libfq/main/libfq.spec
index 892dbb50f..d7d3e3c53 100644
--- a/rpm/redhat/main/common/libfq/main/libfq.spec
+++ b/rpm/redhat/main/common/libfq/main/libfq.spec
@@ -23,6 +23,10 @@ A wrapper library for the Firebird C API, loosely based on libpq for PostgreSQL.
  %setup -q -n %{name}-%{version}

  %build
+%set_build_flags
+%if 0%{?fedora} >= 42
+CFLAGS="-std=gnu17 $CFLAGS"
+%endif
  ./configure --prefix=%{_prefix} \
         --with-ibase=%{_includedir}/firebird --libdir=%{_libdir}/

I continue to research this, but what could
be wrong in my environment if anyone has already encountered this?

By the way, I have pushed my work around to build libfq to
https://repo.or.cz/pgrpms/saper.git/shortlog/refs/heads/libfq-std-gnu17

Marcin

---

From: Marcin Cieslak <[email-masked]>
Date: Sat, 19 Apr 2025 21:33:37 +0000

> I have managed to build libpq with the following patch, so not everything

I mean libfq here, sorry!

---

From: Devrim Gündüz <[email-masked]>
Date: Mon, 21 Apr 2025 19:18:16 +0300

Hi Marcin,

On Sat, 2025-04-19 at 21:31 +0000, Marcin Cieslak wrote:
> error: Empty %files file
> /home/saper/src/pgrpms/rpm/redhat/17/postgresql-17/F-42/postgresql17-
> 17.4-build/postgresql-17.4/debugsourcefiles.list
> 
> RPM build errors:
>      Empty %files file
> /home/saper/src/pgrpms/rpm/redhat/17/postgresql-17/F-42/postgresql17-
> 17.4-build/postgresql-17.4/debugsourcefiles.list

<snip>

> be wrong in my environment if anyone has already encountered this?

Bo idea about that. I experience the same problem on my laptop (Fedora
over the last few years) but none of the build instances have that
problem. Often this is caused because of *some* error in the spec file,
but it is not the case for now.

Regards,
-- 
Devrim Gündüz
Open Source Solution Architect, PostgreSQL Major Contributor
BlueSky: @devrim.gunduz.org , @gunduz.org

---

From: Marcin Cieslak <[email-masked]>
Date: Mon, 21 Apr 2025 17:05:59 +0000

> but it is not the case for now.

Looks like some problem with debugedit tool, I'm on it.

Do I see it right that we do not publish debuginfo and debugsource RPMs?
Do you turn them off on the build machines (and if yes, how)?

Marcin

---

From: Devrim Gündüz <[email-masked]>
Date: Mon, 21 Apr 2025 20:19:02 +0300

Hi,

> Do I see it right that we do not publish debuginfo and debugsource

We do. Please check the repo config file. 

debuginfo-install 

command will do the trick for you.

Regards,

---

From: Marcin Cieslak <[email-masked]>
Date: Wed, 23 Apr 2025 06:38:56 +0000

> but it is not the case for now.

I found the problem. In short, the problem are symbolic links in the repository.
They not only confuse the shell but also the debugedit utility
does not list the source files, because the path provided by the compiler
is in some other directory.

When I 'make rpm17' in the pgrpms/redhat/17/postgresql-17/F-41 directory
debugedit gets -b option that looks like

/home/saper/src/pgrpms/rpm/redhat/17/postgresql-17/F-41/postgresql17-17.4-build/postgresql-17.4

but there are no files with that path, all source files are in

/home/saper/src/pgrpms/rpm/redhat/main/non-common/postgresql-17/F-41/postgresql17-17.4-build/postgresql-17.4

and therefore debugedit finds zero files to list.

A somewhat related question, what is the purpose of

--define "_buildrootdir $(HOME)/rpm17/BUILDROOT"

does it do anything? (it does not seem to have any affect for me)

Marcin

---

From: Devrim Gündüz <[email-masked]>
Date: Wed, 23 Apr 2025 11:19:20 +0300

Hi,

On Wed, 2025-04-23 at 06:38 +0000, Marcin Cieslak wrote:
> /home/saper/src/pgrpms/rpm/redhat/main/non-common/postgresql-17/F-
> 41/postgresql17-17.4-build/postgresql-17.4
> 

Thanks for the analysis -- but please note that we don't have this
problem on the buildfarm instances which have the same symlinks.

> does it do anything? (it does not seem to have any affect for me)

I've written the initial version of those makefiles about 15 years ago.
Cannot remember the details but I think I explicitly defined everything
statically so that even the distro changes a default, we are not
affected (hopefully). It is the same with _specdir, _builddir and etc.

Regards,

---

From: Marcin Cieslak <[email-masked]>
Date: Wed, 23 Apr 2025 17:14:46 +0000

> problem on the buildfarm instances which have the same symlinks.

Building from this directory does not work:

pgrpms/rpm/redhat/17/postgresql-17/F-41

Building from this one works:

pgrpms/rpm/redhat/main/non-common/postgresql-17/F-41

I haven't read the "scripts" directory carefully yet, but it looks
like the packagebuild.sh uses the "non-common" directories to build.

Thank you for all explanations! I got my rpms to build.

Marcin

---

From: Devrim Gündüz <[email-masked]>
Date: Thu, 24 Apr 2025 10:52:57 +0300

Hi,

> like the packagebuild.sh uses the "non-common" directories to build.

Both of them are symlinks actually -- though the former is a symlink to
a symlink.

Regards,

---

From: Marcin Cieslak <[email-masked]>
Date: Thu, 24 Apr 2025 09:59:51 +0000

---

From: Devrim Gündüz <[email-masked]>
Date: Wed, 07 May 2025 15:24:51 +0300

Hi,

> make: *** [../../../../global/Makefile.global-PG17:104: nopreprpm17]

Found something. It fails when I build with a regular user (devrim in
this case), but does not fail when I run the build with postgres user on
the same laptop -- with the same ~/.rpmmacros files. That is why I never
had this issue on the build servers.

I don't have any clues now but could this be something related to the
uid being < 1000 ?

Regards,

---

From: Devrim Gündüz <[email-masked]>
Date: Wed, 07 May 2025 15:36:13 +0300

Hi,

> I don't have any clues now but could this be something related to the

That is a very wrong conclusion -- many debuginfo packages are already
built with devrim user.

Will look more.

Regards,