From b72de496ef6f7d4a76fde6d358df3b8fbb8efa6c Mon Sep 17 00:00:00 2001 From: Pawel Winogrodzki Date: Sat, 16 May 2026 03:08:32 +0000 Subject: [PATCH] qemu: drop qemu-tests subpackage entirely The qemu-tests subpackage ships per-arch test binaries, qemu-iotests fixture images, and accel-qtest-*.so plugins -- artefacts that trip the automated package-signing pipeline's FS-aware deep scanner on the SRPM/RPM payload, blocking the build's signing step. The subpackage is test-only and not consumed by any Azure Linux image manifest or by any other component in the repo. This commit replaces the earlier "empty-out the payload" workaround (which left `%package tests` / `%description tests` / `%files tests` declarations in place and just blanked their content) with a clean removal of the whole subpackage via `spec-remove-subpackage`. Why the indirection ------------------- The upstream qemu.spec sandwiches `%if %{have_libblkio}` between the tests subpackage's `%description` and `%package block-blkio`, and again between `%files tests` and `%files block-blkio`. The `spec-remove-subpackage` overlay greedily consumes everything up to the next section directive, including those trailing `%if` lines, so removing `tests` would leave the block-blkio guards unbalanced (an orphan `%endif` after each block-blkio body). Approach: * `spec-remove-subpackage package = "tests"` drops the three tests sections in one go. * Two `spec-append-lines` overlays re-append `%if %{have_libblkio}`: one against `%description package = "qemu-pr-helper"` (the last `%description` block before `%package block-blkio` in the post-removal spec), and one against `%files package = "common"` (the last `%files` block before `%files block-blkio`). Both are package-scoped so the directive lands at the right anchor; an unscoped `section = "%files"` append silently lands on the FIRST `%files` (the unnamed main one), orphaning `%files block-blkio`. * A `spec-search-replace` re-hoists `%define testsdir %{_libdir}/%{name}/tests-src` to the top of the spec (the original `%define testsdir` lived inside the removed `%package tests` body, but `%install` still references the macro to build the test artefacts). `%define` is used (not `%global`) so `%{name}` and `%{_libdir}` expand lazily at use-time, after rpm has parsed the spec's `Name:` line. * A final `spec-append-lines` in `%install` deletes the test artefacts from `%{buildroot}` after install, so the build's stray output doesn't trip "Installed (but unpackaged)" errors now that there is no `%files tests` to claim them. Files ----- 1. base/comps/qemu/qemu.comp.toml -- new overlays replacing the four empty-out-payload overlays. 2. specs/q/qemu/qemu.spec -- regenerated; `%package tests`, `%description tests`, `%files tests` are all GONE. 3. locks/qemu.lock -- refreshed input-fingerprint. Validation ---------- - `rpmspec -P specs/q/qemu/qemu.spec` parses cleanly (the `%autorelease` warnings are expected and present in the upstream spec too). - `rpmspec -q --qf '%{NAME}\n' specs/q/qemu/qemu.spec | sort -u | grep -c '^qemu-tests$'` returns 0 -- the subpackage is no longer produced. - `%if %{have_libblkio}` still appears immediately before both `%package block-blkio` and `%files block-blkio` in the rendered spec; block-blkio guards are balanced. - Lock converges (re-running `azldev comp update -p qemu` after a fresh render produces no further diff). - Full build NOT run: qemu build time is prohibitive; validated by spec parse and rendered-subpackage inspection. --- base/comps/qemu/qemu.comp.toml | 26 ++++++++++++++++++++++++++ locks/qemu.lock | 2 +- specs/q/qemu/qemu.spec | 29 ++++++++--------------------- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/base/comps/qemu/qemu.comp.toml b/base/comps/qemu/qemu.comp.toml index d7c87c468aa..13a6bca8189 100644 --- a/base/comps/qemu/qemu.comp.toml +++ b/base/comps/qemu/qemu.comp.toml @@ -78,4 +78,30 @@ overlays = [ { description = "Remove %package ui-sdl", type = "spec-remove-section", package = "ui-sdl", section = "%package" }, { description = "Remove %description ui-sdl", type = "spec-remove-section", package = "ui-sdl", section = "%description" }, { description = "Remove %files ui-sdl", type = "spec-remove-section", package = "ui-sdl", section = "%files" }, + + # --- Drop tests subpackage --- + # qemu-tests ships per-arch test binaries, qemu-iotests fixture images, and + # related artefacts that trip the automated package-signing pipeline's + # FS-aware deep scanner. The subpackage is test-only and not shipped in any + # Azure Linux image, so we drop it entirely. + # + # Implementation notes: + # * The upstream spec sandwiches `%if %{have_libblkio}` between the tests + # subpackage's `%description` and `%package block-blkio`, and again + # between `%files tests` and `%files block-blkio`. `spec-remove-subpackage` + # greedily consumes the trailing `%if` lines (per its documented + # limitation), so we re-append `%if %{have_libblkio}` to the end of the + # preceding sections to keep the block-blkio guards balanced. + # * `%define testsdir` lives inside the removed `%package tests` block but + # is referenced from `%install`; we re-hoist it via `%define` (lazy + # expansion of `%{name}` / `%{_libdir}`) near the other top-of-spec + # `%global` declarations so `%install` still expands cleanly. + # * The `%install` section still writes test artefacts under `%{testsdir}` + # and builds `accel-qtest-*.so` plugins, so we rm them from the buildroot + # after install to avoid "Installed (but unpackaged)" errors. + { description = "Hoist `%define testsdir` so %install expands correctly after %package tests is removed", type = "spec-search-replace", regex = '^%global enable_werror 0$', replacement = "%global enable_werror 0\n%define testsdir %{_libdir}/%{name}/tests-src" }, + { description = "Remove qemu-tests subpackage (test-only payload trips signing-pipeline deep scanner; not shipped in any Azure Linux image)", type = "spec-remove-subpackage", package = "tests" }, + { description = "Restore `%if %{have_libblkio}` ahead of %package block-blkio (consumed when the preceding tests subpackage was removed)", type = "spec-append-lines", section = "%description", package = "qemu-pr-helper", lines = ["%if %{have_libblkio}"] }, + { description = "Restore `%if %{have_libblkio}` ahead of %files block-blkio (consumed when the preceding %files tests section was removed)", type = "spec-append-lines", section = "%files", package = "common", lines = ["%if %{have_libblkio}"] }, + { description = "Drop test artefacts from buildroot after install (paired with qemu-tests subpackage removal)", type = "spec-append-lines", section = "%install", lines = ["# Azure Linux: qemu-tests subpackage removed; drop its payload from buildroot.", "rm -rf %{buildroot}%{testsdir}", "rm -f %{buildroot}%{_libdir}/%{name}/accel-qtest-*.so"] }, ] diff --git a/locks/qemu.lock b/locks/qemu.lock index ef24a0625cc..7917f129cd8 100644 --- a/locks/qemu.lock +++ b/locks/qemu.lock @@ -2,5 +2,5 @@ version = 1 import-commit = 'f2cb21ff470d94a6dfd2a2e6ef9effeaa3aead1f' upstream-commit = 'f2cb21ff470d94a6dfd2a2e6ef9effeaa3aead1f' -input-fingerprint = 'sha256:91eb9ed746dbecd75bd0f92c73b84a8ca79c2047ca4592698600326169c3c766' +input-fingerprint = 'sha256:a1ce940376507bb55ef6b3a2f71a78c858e5d517fbed199eee7b8618413bee00' resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e' diff --git a/specs/q/qemu/qemu.spec b/specs/q/qemu/qemu.spec index 7d842c8863b..f8745e2fac5 100644 --- a/specs/q/qemu/qemu.spec +++ b/specs/q/qemu/qemu.spec @@ -157,6 +157,7 @@ %global have_usbredir 1 %global have_xdp 1 %global enable_werror 0 +%define testsdir %{_libdir}/%{name}/tests-src # All modules should be listed here. @@ -817,19 +818,6 @@ This package provides the qemu-pr-helper utility that is required for certain SCSI features. -%package tests -Summary: tests for the %{name} package -Requires: %{name} = %{evr} - -%define testsdir %{_libdir}/%{name}/tests-src - -%description tests -The %{name}-tests rpm contains tests that can be used to verify -the functionality of the installed %{name} package - -Install this package if you want access to qemu-iotests. - - %if %{have_libblkio} %package block-blkio Summary: QEMU blkio block driver @@ -2258,6 +2246,9 @@ rm -f \ +# Azure Linux: qemu-tests subpackage removed; drop its payload from buildroot. +rm -rf %{buildroot}%{testsdir} +rm -f %{buildroot}%{_libdir}/%{name}/accel-qtest-*.so %check # Disable iotests. RHEL has done this forever, and these # tests have been flakey in the past @@ -2548,10 +2539,6 @@ popd %{_sysusersdir}/qemu.conf -%files tests -%{testsdir} -%{_libdir}/%{name}/accel-qtest-*.so - %if %{have_libblkio} %files block-blkio %{_libdir}/%{name}/block-blkio.so @@ -3365,11 +3352,11 @@ popd %changelog ## START: Generated by rpmautospec -* Thu Apr 30 2026 reuben olinsky - 2:10.1.4-3 -- feat(qemu): disable SPICE, dbus video/audio, BrlAPI, all audio backends +* Sat May 16 2026 Pawel Winogrodzki - 2:10.1.4-3 +- qemu: drop qemu-tests subpackage entirely -* Thu Apr 30 2026 Daniel McIlvaney - 2:10.1.4-2 -- feat: introduce deterministic commit resolution via Azure Linux lock file +* Tue May 12 2026 Daniel McIlvaney - 2:10.1.4-2 +- ci(checks): scope render to PR-touched components * Tue Feb 17 2026 Cole Robinson - 2:10.1.4-1 - Rebase to qemu-10.1.4