From 68c8ed2f55a266a0df75c63cc2d2c465f6ead395 Mon Sep 17 00:00:00 2001 From: Simon J Mudd Date: Wed, 29 Jul 2026 19:49:03 +0200 Subject: [PATCH] Bug#120895: Add missing BuildRequires: for el8/el9 (libfido2-devel, libudev-devel, cpp) See: https://bugs.mysql.com/120895 mysql.spec.in's BuildRequires: doesn't fully capture what a clean, minimal-container build actually needs on el8/el9: - The FIDO2/WebAuthn client plugin (add_fido_plugins) is enabled on el8 and later, but libfido2-devel/libudev-devel were only ever declared as BuildRequires for el10, so el8/el9 builds silently skip compiling the plugin, causing the rpm build to fail. - rpcgen shells out to the system C preprocessor to generate xdr_gen/xcom_vp.h; without it rpcgen fails silently and xcom fails to compile. cpp is not declared explicitly in BuildRequires. On el9/el10 yum-builddep's resolution pulls in gcc as a side effect, and gcc itself requires cpp. On el8 this does not happen so it must be declared explicitly. Fix: - Move libfido2-devel/libudev-devel out of the el10-only BuildRequires: section into a shared section using the same condition as add_fido_plugins (%if 0%{?rhel} >= 8). - Add an explicit BuildRequires: cpp for el8 only. --- packaging/rpm-oel/mysql.spec.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in index 6a932134025d..0cabe5dce08c 100644 --- a/packaging/rpm-oel/mysql.spec.in +++ b/packaging/rpm-oel/mysql.spec.in @@ -159,6 +159,14 @@ Source7: %{compatsrc} BuildRequires: cmake >= 3.14.6 BuildRequires: libtirpc-devel BuildRequires: rpcgen +# rpcgen shells out to the system C preprocessor to generate +# xdr_gen/xcom_vp.h. Without it rpcgen fails silently and xcom +# fails to compile. +# cpp is not declared explicitly in BuildRequires. +# On el9/el10 yum-builddep's resolution pulls in gcc as a side effect, +# and gcc itself requires cpp. On el8 this does not happen so it must +# be declared explicitly. +%{?el8:BuildRequires: cpp} %else BuildRequires: cmake3 >= 3.14.6 %endif @@ -195,12 +203,16 @@ BuildRequires: binutils BuildRequires: dwz BuildRequires: gcc-c++ BuildRequires: gcc -BuildRequires: libfido2-devel %ifnarch aarch64 BuildRequires: libquadmath-devel %endif -BuildRequires: libudev-devel %endif # el10 +%if 0%{?rhel} >= 8 +# Needed to build the FIDO2/WebAuthn client plugin, configured similarly to +# add_fido_plugins above to avoid configuration drift. +BuildRequires: libfido2-devel +BuildRequires: libudev-devel +%endif # add_fido_plugins deps (el8+) BuildRequires: bison >= 3.0.4 BuildRequires: elfutils BuildRequires: patchelf