Обсуждение: Empty %files file debugsourcefiles.list
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
Вложения
On Sat, 19 Apr 2025, Marcin Cieslak wrote: > I have managed to build libpq with the following patch, so not everything > is broken: I mean libfq here, sorry!
Вложения
Hi Marcin, On Sat, 2025-04-19 at 21:31 +0000, Marcin Cieslak wrote: > 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 <snip> > I continue to research this, but what could > 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
Вложения
On Mon, 21 Apr 2025, Devrim Gündüz wrote: > 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. 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
Вложения
Hi, On Mon, 2025-04-21 at 17:05 +0000, Marcin Cieslak wrote: > Do I see it right that we do not publish debuginfo and debugsource > RPMs? We do. Please check the repo config file. debuginfo-install command will do the trick for you. Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org
Вложения
On Mon, 21 Apr 2025, Devrim Gündüz wrote: >> 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 > > <snip> > >> I continue to research this, but what could >> 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. 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
Вложения
Hi, On Wed, 2025-04-23 at 06:38 +0000, Marcin Cieslak wrote: > 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. Thanks for the analysis -- but please note that we don't have this problem on the buildfarm instances which have the same symlinks. > > 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) 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, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org
Вложения
On Wed, 23 Apr 2025, Devrim Gündüz wrote: >> /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. > > Thanks for the analysis -- but please note that we don't have this > 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
Вложения
Hi, On Wed, 2025-04-23 at 17:14 +0000, Marcin Cieslak wrote: > > > > Thanks for the analysis -- but please note that we don't have this > > 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. Both of them are symlinks actually -- though the former is a symlink to a symlink. Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org
Вложения
On Thu, 24 Apr 2025, Devrim Gündüz wrote:
> Hi,
>
> On Wed, 2025-04-23 at 17:14 +0000, Marcin Cieslak wrote:
>>>
>>> Thanks for the analysis -- but please note that we don't have this
>>> 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.
>
> Both of them are symlinks actually -- though the former is a symlink to
> a symlink.
From here it looks like this:
$ find -P 17 17/postgresql-17 17/postgresql-17/F-42 main main/non-common main/non-common/postgresql-17
main/non-common/postgresql-17/F-42-ls -prune
16926170 8 drwxr-xr-x 152 saper saper 4096 Apr 18 21:59 17
670798 0 drwxr-xr-x 2 saper saper 94 Apr 18 21:59 17/postgresql-17
670804 0 lrwxrwxrwx 1 saper saper 40 Apr 18 21:59 17/postgresql-17/F-42 ->
../../main/non-common/postgresql-17/F-42
26306366 0 drwxr-xr-x 6 saper saper 68 Apr 18 21:59 main
676643 12 drwxr-xr-x 166 saper saper 8192 Apr 18 21:59 main/non-common
678059 0 drwxr-xr-x 10 saper saper 106 Apr 18 21:59 main/non-common/postgresql-17
16933863 4 drwxr-xr-x 3 saper saper 4096 Apr 21 17:03 main/non-common/postgresql-17/F-42
Most of the *files* in main/non-common/postgresql-17/F-42 are symbolic links, but the source files whose
paths will be embedded in the DWARF information are located in a normal tree of directories:
$ find -P F-42/postgresql17-17.4-build F-42/postgresql17-17.4-build/postgresql-17.4
F-42/postgresql17-17.4-build/postgresql-17.4/src-prune -ls
1099584 0 drwxr-xr-x 4 saper saper 46 Apr 24 09:42 F-42/postgresql17-17.4-build
17946944 4 drwxr-xr-x 6 saper saper 4096 Apr 24 09:43 F-42/postgresql17-17.4-build/postgresql-17.4
1206330 4 drwxr-xr-x 16 saper saper 4096 Apr 24 09:43
F-42/postgresql17-17.4-build/postgresql-17.4/src
The solution could be to move the build tree outside of this symlink maze and things should be fine (if we need those
1[3-8]trees at all).
Sorry for being a pain - this was quite a showstopper for me
Marcin
Вложения
Hi, On Sat, 2025-04-19 at 21:31 +0000, Marcin Cieslak wrote: > 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 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, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org
Вложения
Hi, On Wed, 2025-05-07 at 15:24 +0300, Devrim Gündüz wrote: > > I don't have any clues now but could this be something related to the > uid being < 1000 ? That is a very wrong conclusion -- many debuginfo packages are already built with devrim user. Will look more. Regards, -- Devrim Gündüz Open Source Solution Architect, PostgreSQL Major Contributor BlueSky: @devrim.gunduz.org , @gunduz.org