Skip to content

qemu: drop qemu-tests subpackage entirely#17212

Merged
christopherco merged 1 commit into
4.0from
pawelwi/qemu-drop-tests
May 17, 2026
Merged

qemu: drop qemu-tests subpackage entirely#17212
christopherco merged 1 commit into
4.0from
pawelwi/qemu-drop-tests

Conversation

@PawelWMS
Copy link
Copy Markdown
Contributor

@PawelWMS PawelWMS commented May 14, 2026

Fixes: AB#19874

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.

@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
@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 Outdated
Comment thread base/comps/qemu/qemu.comp.toml Outdated
Comment thread base/comps/qemu/qemu.comp.toml
@PawelWMS PawelWMS force-pushed the pawelwi/qemu-drop-tests branch from 05dd1f5 to 2b35318 Compare May 16, 2026 01:33
@PawelWMS PawelWMS changed the base branch from tomls/base/main to 4.0 May 16, 2026 02:21
@PawelWMS PawelWMS force-pushed the pawelwi/qemu-drop-tests branch 2 times, most recently from 20beef4 to b72de49 Compare May 16, 2026 03:24
Comment thread specs/q/qemu/qemu.spec Outdated
* Thu Apr 30 2026 Daniel McIlvaney <damcilva@microsoft.com> - 2:10.1.4-2
- feat: introduce deterministic commit resolution via Azure Linux lock file
* Tue May 12 2026 Daniel McIlvaney <damcilva@microsoft.com> - 2:10.1.4-2
- ci(checks): scope render to PR-touched components
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@dmcilvaney this seems a bit odd. Is this expected?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No... this feels odd. Will look tomorrow.

Comment thread specs/q/qemu/qemu.spec Outdated
## START: Generated by rpmautospec
* 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
* Sat May 16 2026 Pawel Winogrodzki <pawelwi@microsoft.com> - 2:10.1.4-3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Release calc seems broken here, should increment.

Copy link
Copy Markdown
Contributor

@dmcilvaney dmcilvaney left a comment

Choose a reason for hiding this comment

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

Azldev release calc seems wrong

@dmcilvaney dmcilvaney force-pushed the pawelwi/qemu-drop-tests branch from 0f9da6c to 37cbf4e Compare May 16, 2026 18:02
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.
@dmcilvaney dmcilvaney force-pushed the pawelwi/qemu-drop-tests branch from 37cbf4e to 5c1eb9d Compare May 16, 2026 18:10
@christopherco christopherco merged commit fe6af7a into 4.0 May 17, 2026
10 checks passed
@christopherco christopherco deleted the pawelwi/qemu-drop-tests branch May 17, 2026 05:30
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.

4 participants