Skip to content

feat: add libguestfs and guestfs-tools packages to enable static image tests#18041

Open
trungams wants to merge 11 commits into
4.0from
tvuong/4.0/enable-image-test
Open

feat: add libguestfs and guestfs-tools packages to enable static image tests#18041
trungams wants to merge 11 commits into
4.0from
tvuong/4.0/enable-image-test

Conversation

@trungams

@trungams trungams commented Jul 16, 2026

Copy link
Copy Markdown
Member

Picking up from #17624

Adds the libguestfs and guestfs-tools package (library + guestfish/virt-* tools for accessing and modifying VM disk images) to Azure Linux 4.0, imported from Fedora dist-git with the full Fedora binding set and no overlays to keep divergence minimal for regular Fedora-baseline refreshes.

This PR includes the following changes/additions:

  • fix(hivex): re-enable OCaml bindings: reverts the earlier workaround (bf151bb) that disabled hivex's OCaml bindings due to a broken bootstrap OCaml toolchain. The bootstrap is now resolved, so hivex again provides ocaml-hivex-devel, a mandatory libguestfs build dependency. The dedicated comp file is removed and hivex returns to an inline entry.
  • feat(supermin): add supermin component: adds the appliance builder libguestfs depends on, with an overlay patch teaching supermin's package manager detection to recognize ID=azurelinux (upstream only checks a hard-coded ID allow-list, ignoring ID_LIKE). The patch is flagged for upstream submission.
  • feat(libguestfs): add libguestfs component: adds libguestfs with the full Fedora binding set (OCaml, Perl, Python, Ruby, Lua, PHP, GObject/Vala) and no overlays.
  • feat(ocaml-*): add ocaml build dependencies for guestfs-tools
  • feat(guestfs-tools): add guestfs-tools with the full set of virt-* tools with 2 overlays to keep %check section pass.

Verification:

azldev image build vm-base-dev 
azldev image test vm-base-dev

Fixes: AB#20621

@trungams
trungams requested a review from a team as a code owner July 16, 2026 21:35
Copilot AI review requested due to automatic review settings July 16, 2026 21:35

Copilot AI left a comment

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.

Pull request overview

Adds libguestfs, guestfs-tools, supermin, and required OCaml dependencies for VM image testing.

Changes:

  • Imports the new package stack and lock files.
  • Re-enables hivex OCaml bindings.
  • Adds Azure Linux compatibility and test overlays.

Reviewed changes

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

Show a summary per file
File Description
base/comps/components.toml Registers unmodified imports.
base/comps/guestfs-tools/0001-tests-do-not-build-the-Windows-phony-guest-image.patch Skips Windows test image generation.
base/comps/guestfs-tools/guestfs-tools.comp.toml Defines guestfs-tools overlays.
base/comps/hivex/hivex.comp.toml Removes OCaml disablement.
base/comps/supermin/0001-Recognize-Azure-Linux-as-an-rpm-dnf-distro.patch Adds Azure Linux detection.
base/comps/supermin/supermin.comp.toml Defines the supermin overlay.
locks/guestfs-tools.lock Pins guestfs-tools.
locks/hivex.lock Refreshes hivex inputs.
locks/libguestfs.lock Pins libguestfs.
locks/ocaml-fileutils.lock Pins ocaml-fileutils.
locks/ocaml-gettext.lock Pins ocaml-gettext.
locks/ocaml-lwt.lock Pins ocaml-lwt.
locks/ocaml-ounit.lock Pins ocaml-ounit.
locks/ocaml-ppx-here.lock Pins ocaml-ppx-here.
locks/ocaml-ppx-let.lock Pins ocaml-ppx-let.
locks/supermin.lock Pins supermin.
specs/g/guestfs-tools/0001-tests-do-not-build-the-Windows-phony-guest-image.patch Renders the test patch.
specs/g/guestfs-tools/guestfs-tools.spec Packages virt-* tools.
specs/g/guestfs-tools/libguestfs.keyring Supplies signature keys.
specs/g/guestfs-tools/sources Records source hashes.
specs/h/hivex/hivex.azl.macros Removes OCaml-disable macro.
specs/h/hivex/hivex.spec Re-enables OCaml bindings.
specs/l/libguestfs/README-replacement.in Supplies packaged documentation.
specs/l/libguestfs/copy-patches.sh Imports maintainer helper.
specs/l/libguestfs/guestfish.sh Configures guestfish prompts.
specs/l/libguestfs/libguestfs.keyring Supplies signature keys.
specs/l/libguestfs/libguestfs.spec Packages libguestfs and bindings.
specs/l/libguestfs/sources Records source hashes.
specs/l/libguestfs/yum.conf.in Configures appliance repository.
specs/o/ocaml-fileutils/ocaml-fileutils.spec Packages ocaml-fileutils.
specs/o/ocaml-fileutils/sources Records source hash.
specs/o/ocaml-gettext/37.patch Removes dune-site usage.
specs/o/ocaml-gettext/ocaml-gettext.spec Packages ocaml-gettext.
specs/o/ocaml-gettext/sources Records source hash.
specs/o/ocaml-lwt/ocaml-lwt-mathlib.patch Adds math-library linkage.
specs/o/ocaml-lwt/ocaml-lwt-ppxlib-0.36.patch Adds ppxlib compatibility.
specs/o/ocaml-lwt/ocaml-lwt.spec Packages ocaml-lwt.
specs/o/ocaml-lwt/sources Records source hash.
specs/o/ocaml-ounit/0001-Remove-stdlib-shims.patch Removes obsolete dependencies.
specs/o/ocaml-ounit/ocaml-ounit.spec Packages ocaml-ounit.
specs/o/ocaml-ounit/sources Records source hash.
specs/o/ocaml-ppx-here/ocaml-ppx-here.spec Packages ocaml-ppx-here.
specs/o/ocaml-ppx-here/sources Records source hash.
specs/o/ocaml-ppx-let/ocaml-ppx-let.spec Packages ocaml-ppx-let.
specs/o/ocaml-ppx-let/sources Records source hash.
specs/s/supermin/0001-Recognize-Azure-Linux-as-an-rpm-dnf-distro.patch Renders Azure Linux detection.
specs/s/supermin/0001-prepare-Use-stable-owner-group-and-mtime-in-base.tar.patch Makes appliance archives reproducible.
specs/s/supermin/libguestfs.keyring Supplies signature keys.
specs/s/supermin/sources Records source hashes.
specs/s/supermin/supermin-find-requires Generates appliance dependencies.
specs/s/supermin/supermin.attr Registers RPM dependency generator.
specs/s/supermin/supermin.spec Packages supermin.

Comment thread base/comps/guestfs-tools/guestfs-tools.comp.toml Outdated
Comment thread base/comps/components.toml
@tobiasb-ms

Copy link
Copy Markdown
Contributor

It likes like this branch is woefully behind 4.0. Do a rebase please.

christopherco and others added 9 commits July 17, 2026 21:52
The bootstrap OCaml toolchain (ocaml-findlib-devel) had ABI-mismatched
module hashes that prevented dependency resolution, which forced the
workaround in bf151bb to disable hivex's OCaml bindings via
build.without = ["ocaml"].

The OCaml bootstrap sequence is now resolved (verified by a clean
ocaml-augeas build, which consumes ocaml-findlib-devel), so this reverts
the workaround. hivex now builds the ocaml-hivex / ocaml-hivex-devel
subpackages again, which libguestfs requires as a mandatory build
dependency. With no overlays remaining, the dedicated comp file is
removed and the component returns to an inline entry.
supermin builds the minimal appliance image used by libguestfs. Imported
from Fedora dist-git.

Includes an overlay patch teaching supermin's package-manager
auto-detection (src/ph_rpm.ml) to recognize Azure Linux. Upstream only
inspects the os-release ID field against a hard-coded allow-list and does
not consider ID_LIKE; Azure Linux sets ID=azurelinux (ID_LIKE=fedora) and
ships no /etc/redhat-release marker, so without the patch supermin aborts
with "could not detect package manager used by this system or distro",
which also breaks the libguestfs appliance build. The patch should be
submitted upstream (https://github.com/libguestfs/supermin).
libguestfs is a library and set of tools (guestfish, virt-* utilities)
for accessing and modifying virtual machine disk images. Imported from
Fedora dist-git with the full Fedora binding set (OCaml, Perl, Python,
Ruby, Lua, PHP, GObject/Vala) and no overlays, keeping divergence from
upstream minimal for regular Fedora-baseline refreshes.

Requires the supermin component (added in a prior commit) and the
ocaml-hivex-devel subpackage re-enabled in hivex. Build was validated end
to end: the appliance builds and the upstream %check boots the appliance
under KVM and runs libguestfs-test-tool against both the libvirt and
direct backends, with both reporting TEST FINISHED OK.
OCaml build dependency for guestfs-tools.
OCaml build dependency for guestfs-tools.
OCaml build dependency for guestfs-tools.
OCaml build dependency for guestfs-tools.
OCaml build dependency for guestfs-tools.
OCaml build dependency for guestfs-tools.
Copilot AI review requested due to automatic review settings July 17, 2026 21:58
@trungams
trungams force-pushed the tvuong/4.0/enable-image-test branch from f8bfc13 to c979183 Compare July 17, 2026 21:58

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 38 out of 52 changed files in this pull request and generated 4 comments.

[components.hipsparse]
[components.hipsparselt]
[components.hiredis]
[components.hivex]
[components.libgee]
[components.libgeotiff]
[components.libgexiv2]
[components.libguestfs]
Comment thread base/comps/guestfs-tools/guestfs-tools.comp.toml Outdated
Comment thread base/comps/components.toml
Copilot AI review requested due to automatic review settings July 17, 2026 22:19
@trungams
trungams force-pushed the tvuong/4.0/enable-image-test branch from c979183 to 6b2713c Compare July 17, 2026 22:19

Copilot AI left a comment

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.

Pull request overview

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

Comments suppressed due to low confidence (1)

base/comps/guestfs-tools/guestfs-tools.comp.toml:31

  • This insertion does not require a search/replace: the variable only needs to be set before the existing %check body runs. Using spec-prepend-lines avoids coupling the overlay to Fedora's SKIP_TEST_VIRT_RESIZE_PL line, which may move or disappear during a baseline refresh.
type = "spec-search-replace"
section = "%check"
regex = 'export SKIP_TEST_VIRT_RESIZE_PL=1'

Comment on lines +712 to +714
%if 0%{?rhel}
QEMU=%{_libexecdir}/qemu-kvm \
%endif
Comment on lines +732 to +736
--disable-gobject \
--disable-lua \
--disable-php \
--disable-ruby \
%endif
trungams added 2 commits July 17, 2026 22:32
Provides virt-inspector and the other virt-* tools on top of libguestfs.

Two targeted %check overlays keep the test suite enabled in the KVM-less
build sandbox instead of disabling it: drop the Windows phony-guest image
(its mkfs.ntfs step fails under TCG emulation and, being check_DATA, would
fail the whole %check) and skip test-virt-diff.sh via the suite's own
SKIP_TEST_VIRT_DIFF_SH hook (virt-diff spuriously flags the guest's separate
/boot partition as changed after the appliance mounts the image). All other
tests run.
There is no `libguestfs-tools` package: guestmount/guestunmount are
provided by `libguestfs` and virt-inspector by `guestfs-tools`. Update
the prerequisite docs (README) and the native-tool preflight hints
(utils/extract.py, utils/tools.py) to reference packages that exist, so
the "install this" guidance is actionable.
Copilot AI review requested due to automatic review settings July 17, 2026 22:40
@trungams
trungams force-pushed the tvuong/4.0/enable-image-test branch from 6b2713c to b04943a Compare July 17, 2026 22:40

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 41 out of 55 changed files in this pull request and generated no new comments.

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