ossobv / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
0 stars 0 forks source link

build: SONIC_DEBUGGING_ON=y causes ipmitool-dbgsym other dbgsyms to _not_ get built #19

Open wdoekes opened 1 day ago

wdoekes commented 1 day ago

SONIC_DEBUGGING_ON=y sets DEB_BUILD_OPTIONS=nostrip and for certain packages, this causes dbgsym packages to not be produced.

Upstream bug: #-5982.

Getting no dbgsym package when debugging is on feels like the inverse of what we expect.

See this:

Example with nostrip:

/sonic/src/ipmitool/ipmitool-1.8.19$ DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -rfakeroot -d -b -us -uc -j32 --admindir /tmp/foobar
...
dh: command-omitted: The call to "dh_dwz" was omitted due to "DEB_BUILD_OPTIONS=nostrip"
dh: command-omitted: The call to "dh_strip" was omitted due to "DEB_BUILD_OPTIONS=nostrip"
   dh_makeshlibs -a
   dh_shlibdeps -a
   dh_installdeb
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'ipmitool' in '../ipmitool_1.8.19-4+deb12u1_amd64.deb'.
 dpkg-genbuildinfo --build=binary --admindir=/tmp/foobar -O../ipmitool_1.8.19-4+deb12u1_amd64.buildinfo
 dpkg-genchanges --build=binary -O../ipmitool_1.8.19-4+deb12u1_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)

^- no ipmitool-dbgsym_1.8.19-4+deb12u1_amd64.deb created

/sonic/src/ipmitool/ipmitool-1.8.19$ dpkg-buildpackage -rfakeroot -d -b -us -uc -j32 --admindir /tmp/foobar
...
   dh_dwz -a
   dh_strip -a
   dh_makeshlibs -a
   dh_shlibdeps -a
   dh_installdeb
   dh_gencontrol
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'ipmitool' in '../ipmitool_1.8.19-4+deb12u1_amd64.deb'.
dpkg-deb: building package 'ipmitool-dbgsym' in '../ipmitool-dbgsym_1.8.19-4+deb12u1_amd64.deb'.
 dpkg-genbuildinfo --build=binary --admindir=/tmp/foobar -O../ipmitool_1.8.19-4+deb12u1_amd64.buildinfo
 dpkg-genchanges --build=binary -O../ipmitool_1.8.19-4+deb12u1_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)

^- now both files are created

I did find this on the internet: https://lists.debian.org/debian-devel/2015/05/msg00472.html

  * DH inhibits ddeb creation when either "dh_strip -k", "dh_strip
    --dbg-package" is used or when either "noddebs" or "nostrip" are
    given as/in DEB_BUILD_OPTIONS.

But not so much info here: https://manpages.debian.org/testing/debhelper/debhelper-compat-upgrade-checklist.7.en.html

I'm not entirely sure why/what. It could be the debhelper/compat mode that is related, or there is something else that I haven't seen yet. But the results speak for themselves: nostrip is not an expected feature, because the it breaks the build which expects the ipmitool-dbgsym to be built.

Perhaps we want DEB_BUILD_OPTIONS_GENERIC := debug instead?

wdoekes commented 1 day ago

https://lists.debian.org/debian-devel/2016/05/msg00199.html

The option is 'nostrip'. It also seems redundant now, given that the default is to distribute debug symbols separately rather than to strip them entirely.

Finally found this: https://manpages.ubuntu.com/manpages/focal/man1/dh_strip.1.html

If the DEB_BUILD_OPTIONS environment variable contains nostrip, nothing will be stripped, in accordance with Debian policy (section 10.1 "Binaries"). This will also inhibit the automatic creation of debug symbol packages.