Showing posts with label rpmbuild. Show all posts
Showing posts with label rpmbuild. Show all posts


RPM generation error “Missing build-id”

I came across this error while trying to build an RPM for apptainer on my system, which is older than what is supported by the authors. The compilation process seems to complete successfully, but at the end, no RPM is generated. These messages are shown:
    error: Missing build-id in /home/swbuild/rpmbuild/BUILDROOT/apptainer-1.1.3-1.el8.x86_64/usr/libexec/apptainer/bin/squashfuse_ll
    error: Generating build-id links failed

    RPM build errors:
        Macro expanded in comment on line 97: %{?el7}

        Missing build-id in /home/swbuild/rpmbuild/BUILDROOT/apptainer-1.1.3-1.el8.x86_64/usr/libexec/apptainer/bin/squashfuse_ll
        Generating build-id links failed
This is because older versions of GCC do not include the build-id by default. The fix is to add LDFLAGS="-Wl,--build-id" to the configure line in the file, e.g.
    FLAGS=-std=c99 LDFLAGS="-Wl,--build-id" ./configure --enable-multithreading


rpmbuild, SPEC files, and prerequisites

At some point or other, you may try to build an RPM from a SPEC file and find that you are missing some dependencies:
$ rpmbuild -ba rt4.spec
error: Failed build dependencies:
        /usr/share/fonts/google-droid/DroidSansFallback.ttf is needed by rt4-4.0.8-0.20121228.0.el6.noarch
        /usr/share/fonts/google-droid/DroidSans.ttf is needed by rt4-4.0.8-0.20121228.0.el6.noarch
You may think (at least, I did) that all you need to do is to make sure those files exist. Unfortunately, no: you will need to install packages which provide those files (or capabilities, in the RPM jargon). In this case:

$ yum whatprovides /usr/share/fonts/google-droid/DroidSans.ttf
google-droid-sans-fonts-20100409-1.el6.noarch : A humanist sans serif typeface
Repo        : myownrepo-6-x86_64-server
Matched from:
Filename    : /usr/share/fonts/google-droid/DroidSans.ttf
If you look in the SPEC file:
Requires:  /usr/share/fonts/google-droid/DroidSansFallback.ttf
Requires:  /usr/share/fonts/google-droid/DroidSans.ttf
BuildRequires:  /usr/share/fonts/google-droid/DroidSansFallback.ttf
BuildRequires:  /usr/share/fonts/google-droid/DroidSans.ttf
As described in the link about capabilities above, those lines do not just specify package names but capabilities, which then mean that the package you are working on will require packages which provide the listed capabilities.