Skip to content

qemu: drop qemu-tests subpackage entirely#17212

Open
PawelWMS wants to merge 1 commit into
tomls/base/mainfrom
pawelwi/qemu-drop-tests
Open

qemu: drop qemu-tests subpackage entirely#17212
PawelWMS wants to merge 1 commit into
tomls/base/mainfrom
pawelwi/qemu-drop-tests

Conversation

@PawelWMS
Copy link
Copy Markdown
Contributor

@PawelWMS PawelWMS commented May 14, 2026

Koji build

The qemu-tests subpackage ships per-arch test binaries, qemu-iotests fixture images, and accel-qtest-*.so plugins. Those artefacts 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.

Approach

Drop the whole qemu-tests subpackage cleanly via spec-remove-subpackage. The naive approach trips two overlay-engine quirks (see azure-linux-dev-tools#193) that this PR works around:

  1. Greedy %if consumption. 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 walks forward to the next section directive, swallowing the %if lines and orphaning their %endifs. 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),
    • one against %files package = "common" (the last %files block before %files block-blkio).
      Both are package-scoped — an unscoped section = "%files" append silently lands on the FIRST %files (the unnamed main one), which would orphan %files block-blkio.
  2. %define testsdir inside the removed body. The upstream spec puts %define testsdir %{_libdir}/%{name}/tests-src inside %package tests, but %install still uses %{testsdir} to build test artefacts. After the removal the macro is undefined and %install expands to broken paths. A spec-search-replace hoists an equivalent %global testsdir ... to the top of the spec, next to the other %global declarations.

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.

Validation

  • rpmspec -P specs/q/qemu/qemu.spec exits 0 (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 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.

Reverse-dependency check

No other component in the repo declares Requires: / BuildRequires: on qemu-tests, and no Azure Linux image manifest references it.

@github-actions
Copy link
Copy Markdown

📄❌ Rendered specs are out of date

FIX: — run this and commit the result:

azldev component render qemu

Or download the fix patch and apply it:

gh run download 25839015261 -R microsoft/azurelinux -n rendered-specs-patch
git apply rendered-specs.patch
Category Count
Content diffs 1
Extra files (untracked) 0
Missing files (deleted) 0

Content diffs

`specs/q/qemu/qemu.spec`
--- committed/specs/q/qemu/qemu.spec
+++ rendered/specs/q/qemu/qemu.spec
@@ -3368,8 +3368,8 @@
 
 %changelog
 ## START: Generated by rpmautospec
-* Thu May 14 2026 azldev <azldev@local> - 2:10.1.4-4
-- Local changes (uncommitted)
+* Thu May 14 2026 Pawel Winogrodzki <pawelwi@microsoft.com> - 2:10.1.4-4
+- qemu: empty out qemu-tests subpackage payload
 
 * Thu Apr 30 2026 reuben olinsky <reubeno@users.noreply.github.com> - 2:10.1.4-3
 - feat(qemu): disable SPICE, dbus video/audio, BrlAPI, all audio backends

@PawelWMS PawelWMS force-pushed the pawelwi/qemu-drop-tests branch from 0742967 to b723955 Compare May 14, 2026 23:15
@PawelWMS PawelWMS force-pushed the pawelwi/qemu-drop-tests branch 2 times, most recently from 112b9b7 to 3a5696a Compare May 15, 2026 17:36
@PawelWMS PawelWMS marked this pull request as ready for review May 15, 2026 17:38
Copilot AI review requested due to automatic review settings May 15, 2026 17:38
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` hoists a `%global testsdir
  %{_libdir}/%{name}/tests-src` declaration 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).
* 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.
@PawelWMS PawelWMS force-pushed the pawelwi/qemu-drop-tests branch from 3a5696a to 05dd1f5 Compare May 15, 2026 17:41
@PawelWMS PawelWMS changed the title qemu: empty out qemu-tests subpackage payload qemu: drop qemu-tests subpackage entirely May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Azure Linux qemu component customization to avoid shipping qemu-tests artifacts that trigger the signing pipeline’s deep scanner, by removing the tests payload/subpackage-related outputs from the rendered spec.

Changes:

  • Removes the qemu-tests subpackage from the rendered qemu.spec and adds %install cleanup to delete test artifacts from %{buildroot}.
  • Hoists a testsdir macro definition so %install continues to parse/expand after the tests subpackage removal.
  • Updates the qemu lock fingerprint to reflect the component definition change.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
specs/q/qemu/qemu.spec Rendered spec updated: tests subpackage blocks removed; testsdir added; %install now deletes test artifacts from buildroot.
base/comps/qemu/qemu.comp.toml Adds overlays to remove the tests subpackage, restore %if %{have_libblkio} guards, and clean test artifacts post-install.
locks/qemu.lock Updates input fingerprint for the modified component definition.

Comment thread specs/q/qemu/qemu.spec
%global have_usbredir 1
%global have_xdp 1
%global enable_werror 0
%global testsdir %{_libdir}/%{name}/tests-src
Comment on lines +101 to +103
{ description = "Hoist `%global 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%global 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}"] },
Comment on lines +102 to +105
{ 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"] },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants