Subject: How are debuginfo packages generated?

From: Daniel Farina <[email-masked]>
Date: Fri, 05 Jan 2018 22:30:56 +0000

Hello,

For quite some time, I've been building lightly modified PGDG packages, but
I have never figured how PGDG's yum repo gets debuginfo packages. When I
have built them, unless I hack up the spec file to have "%debug_package" I
do not get such a debuginfo package. Clearly, that is not how the spec
files work as-is in pgrpms.

Yet, I know that PGDG's yum repositories have no problem getting debuginfo
packages. How do you get them?

Thanks,
Daniel

---

From: Craig Ringer <[email-masked]>
Date: Sat, 6 Jan 2018 13:50:48 +0800

On 6 January 2018 at 06:30, Daniel Farina <[email-masked]> wrote:

> Hello,
>
> For quite some time, I've been building lightly modified PGDG packages,
> but I have never figured how PGDG's yum repo gets debuginfo packages. When
> I have built them, unless I hack up the spec file to have "%debug_package"
> I do not get such a debuginfo package. Clearly, that is not how the spec

How do you invoke rpmbuild?

I get debuginfo packages. I build srpms then rpmbuild --rebuild them.
Usually using mock, though moving toward docker these days so I can use the
same toolchain for my debian build pipeline too.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

---

From: Daniel Farina <[email-masked]>
Date: Sat, 06 Jan 2018 05:52:12 +0000

> How do you invoke rpmbuild?

Via make nopreprpm10.

---

From: Pavel Raiskup <[email-masked]>
Date: Sat, 06 Jan 2018 07:48:32 +0100

> > How do you invoke rpmbuild?

I've never heard about nopreprpm10, but it is more important to say where
you build the package because debuginfo generator is tightly dependant on
the _setup_ in packages like 'rpm', 'redhat-rpm-config', etc.

Have a look at `rpm --eval %debug_package` output to see what happens
there, and to see why it is needed.  Then, study your system/user rpm macros.
On my system (Fedora 27 x86_64), there's is (in /usr/lib/rpm/redhat/macros):

  ...
  %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
  %%install\
  %{nil}
  ...

. so the %debug_package content is automatically hooked right before
%install by default, but only if %_enable_debug_packages is defined (the
default though).  Then, you need to have all the stuff done correctly in
%__debug_install_post (namely /usr/lib/rpm/find-debuginfo.sh should be
%called) but this appears to be OK on your system.

Pavel

---

From: Daniel Farina <[email-masked]>
Date: Mon, 08 Jan 2018 23:50:24 +0000

> /usr/lib/rpm/redhat/macros):

Seems to me _enable_debug_packages is not "1" on Amazon Linux, nor is that
hook in in /usr/lib/rpm/redhat/macros, though that can be from simple
divergence of sorts. I also have a Fedora 27 to compare to. I wonder how
the PGDG repository did this on the older Amazon Linux it supported? Did it?

I'll bark up that tree for a while. Thanks.

---

From: Devrim Gündüz <[email-masked]>
Date: Tue, 09 Jan 2018 21:40:03 +0300

Hi,

On Mon, 2018-01-08 at 23:50 +0000, Daniel Farina wrote:
> I wonder how the PGDG repository did this on the older Amazon Linux it
> supported? Did it?

Amazon Linux were using RHEL 6 RPMs -- I did not build them on Amazon Linux.

:)

Regards,

-- 
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

---

From: Daniel Farina <[email-masked]>
Date: Mon, 26 Mar 2018 18:28:20 +0000

> I'll bark up that tree for a while. Thanks.

I did that, and adding this to .rpmmacros does the deed:

I also had to place augment my rpmbuild definitions with an additional
'--define "_enable_debug_packages 1"'

I'm baffled how Amazon packages go about providing debuginfo, seeing as how
these facilities have been changed(?). I haven't investigated it.