RPM build ERROR: No build ID note found on pre-compiled binaries

Written by - 0 comments

Published on - Listed in Linux


When I was about to build an RPM package with pre-compiled x86_64 binaries in it, I ran into rpmbuild errors.

The error mention "No build ID note found" on the pre-compiled binaries:

root@rocky8 ~ # rpmbuild -bb --nodeps /opt/my-fancy-package-${pkg_version}/my-fancy-package.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.VyPpLG
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf my-fancy-package-0.1.0
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/my-fancy-package-0.1.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd my-fancy-package-0.1.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.9iIleH
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd my-fancy-package-0.1.0
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.n8LSLi
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
++ dirname /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
+ cd my-fancy-package-0.1.0
+ /usr/bin/install -D bin/node_exporter /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/node_exporter
+ /usr/bin/install -D bin/process_exporter /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/process_exporter
+ /usr/bin/install -D bin/script_exporter /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/script_exporter
+ /usr/lib/rpm/find-debuginfo.sh -j16 --strict-build-id -m -i --build-id-seed 0.1.0-1.el8 --unique-debug-suffix -0.1.0-1.el8.x86_64 --unique-debug-src-base my-fancy-package-0.1.0-1.el8.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /root/rpmbuild/BUILD/my-fancy-package-0.1.0
extracting debug info from /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/script_exporter
extracting debug info from /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/node_exporter
/usr/lib/rpm/debugedit: /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/node_exporter: DWARF version 0 unhandled
*** ERROR: No build ID note found in /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/script_exporter
*** ERROR: No build ID note found in /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/node_exporter

/usr/lib/rpm/find-debuginfo.sh: line 501: /tmp/find-debuginfo.aSCvun/res.*: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.n8LSLi (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.n8LSLi (%install)

According to a thread in the Fedora Forums, this error comes from the debuginfo script, which is launched to build a debug rpm package.

As I don't need such a debug package, I disabled building a debug package by adding the following macro in the spec file:

%define debug_package %{nil}

Note: I added this just below the %description section inside the spec file

After this change in the spec file, I rebuilt the source file and created another srpm file:

root@rocky8 /opt # tar -czf ~/rpmbuild/SOURCES/my-fancy-package-${pkg_version}.tar.gz my-fancy-package-${pkg_version}/
root@rocky8 /opt # rpmbuild -bs /opt/my-fancy-package-${pkg_version}/my-fancy-package.spec
Wrote: /root/rpmbuild/SRPMS/my-fancy-package-0.1.0-1.el8.src.rpm

Final test, building the binary rpm:

root@rocky8 /opt # rpmbuild -bb --nodeps /opt/my-fancy-package-${pkg_version}/my-fancy-package.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.24cAkm
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf my-fancy-package-0.1.0
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/my-fancy-package-0.1.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd my-fancy-package-0.1.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.NHxXLb
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd my-fancy-package-0.1.0
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.H1LVR8
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
++ dirname /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
+ cd my-fancy-package-0.1.0
+ /usr/bin/install -D bin/node_exporter /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/node_exporter
+ /usr/bin/install -D bin/process_exporter /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/process_exporter
+ /usr/bin/install -D bin/script_exporter /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/script_exporter
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
/sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile '' 1
+ /usr/lib/rpm/brp-python-hardlink
+ PYTHON3=/usr/libexec/platform-python
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
Processing files: my-fancy-package-0.1.0-1.el8.x86_64
warning: Missing build-id in /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/node_exporter
warning: Missing build-id in /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/process_exporter
warning: Missing build-id in /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64/usr/bin/script_exporter
Provides: my-fancy-package = 0.1.0-1.el8 my-fancy-package(x86-64) = 0.1.0-1.el8
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit)
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
Wrote: /root/rpmbuild/RPMS/x86_64/my-fancy-package-0.1.0-1.el8.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.7bAl4i
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd my-fancy-package-0.1.0
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/my-fancy-package-0.1.0-1.el8.x86_64
+ exit 0

Yes! It worked, the rpm package was built!

Of course this is now moved into a CI/CD pipeline to automate the build process.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder