packagingrpmbuild

How do I disable `rpmbuild` Duplicate build-ids errors?


While trying to rebuild qemu, I get these errors:

    Duplicate build-ids /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-aarch64.so and /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-or1k.so
    Duplicate build-ids /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-aarch64.so and /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-ppc.so
    Duplicate build-ids /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-aarch64.so and /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-ppc64.so
    Duplicate build-ids /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-aarch64.so and /usr/src/rpmbuild/BUILDROOT/qemu-7.2.0-6.el9.x86_64/usr/lib64/qemu/accel-qtest-riscv32.so

What causes rpmbuild to emit Duplicate build-ids errors?


Solution

  • This does not solve the underlying problem, but it will prevent creating build-ids and therefore not generate the error. Define this at the top of the .spec:

    %define _build_id_links none