From 8740a6ffb60b2487cf5b4c255c1bb043a615c055 Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Mon, 17 Aug 2026 17:30:47 +0000 Subject: [PATCH 1/2] feat(openvmm): onboard OpenVMM to Azure Linux 4.0 OpenVMM is a modular, cross-platform virtual machine monitor written in Rust. This packages the host binary, which runs virtual machines on Linux via KVM or the Microsoft Hypervisor. The build is fully offline: upstream publishes a vendor archive as a release asset alongside the tag archive, and the cargo_config shipped in that archive maps the workspace's git dependencies into the vendor tree. Requires a Rust toolchain of 1.95.0 or newer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50ad1e94-a714-4445-bf61-acec0dec4d22 --- base/comps/openvmm/openvmm.comp.toml | 20 +++++++ base/comps/openvmm/openvmm.spec | 74 +++++++++++++++++++++++ locks/openvmm.lock | 3 + specs/o/openvmm/openvmm.spec | 87 ++++++++++++++++++++++++++++ specs/o/openvmm/sources | 2 + 5 files changed, 186 insertions(+) create mode 100644 base/comps/openvmm/openvmm.comp.toml create mode 100644 base/comps/openvmm/openvmm.spec create mode 100644 locks/openvmm.lock create mode 100644 specs/o/openvmm/openvmm.spec create mode 100644 specs/o/openvmm/sources diff --git a/base/comps/openvmm/openvmm.comp.toml b/base/comps/openvmm/openvmm.comp.toml new file mode 100644 index 00000000000..475fa5cccb6 --- /dev/null +++ b/base/comps/openvmm/openvmm.comp.toml @@ -0,0 +1,20 @@ +# OpenVMM — modular, cross-platform virtual machine monitor. +# Not packaged by Fedora; maintained as a local spec using rpmautospec +# (%autorelease / %autochangelog). +# +# Upstream publishes a vendor archive as a release asset, so the build resolves +# every crate offline from it. Both sources are fetched from the release tag. +[components.openvmm] +spec = { type = "local", path = "openvmm.spec" } + +[[components.openvmm.source-files]] +filename = "openvmm-0.1.0.tar.gz" +hash = "066c127e0f9b0e2fd34b5259b699688f8fed92d86f4b2d26c647057654568227aeb22de4d08ab1fc203f0b2f9a57144190bad778fc228d2ed456298a109c1f8b" +hash-type = "SHA512" +origin = { type = "download", uri = "https://github.com/microsoft/openvmm/archive/openvmm-v0.1.0/openvmm-0.1.0.tar.gz" } + +[[components.openvmm.source-files]] +filename = "openvmm-0.1.0-vendor.tar.gz" +hash = "6ee0c42d2500808069c8083cb9340adc2fdf1ba01647679dbaa5350beb923454ec28405860afaa33f7a86676a20544cc32cc8385035babfdf3f9c44a6cc47ca1" +hash-type = "SHA512" +origin = { type = "download", uri = "https://github.com/microsoft/openvmm/releases/download/openvmm-v0.1.0/openvmm-0.1.0-vendor.tar.gz" } diff --git a/base/comps/openvmm/openvmm.spec b/base/comps/openvmm/openvmm.spec new file mode 100644 index 00000000000..323bcc75ef2 --- /dev/null +++ b/base/comps/openvmm/openvmm.spec @@ -0,0 +1,74 @@ +Name: openvmm +Version: 0.1.0 +Release: %autorelease +Summary: Modular, cross-platform virtual machine monitor + +License: MIT +URL: https://github.com/microsoft/openvmm +Source0: %{url}/archive/openvmm-v%{version}/%{name}-%{version}.tar.gz +# Published with the release; contains the vendor tree and the cargo_config that +# maps the workspace's git dependencies into it. +Source1: %{url}/releases/download/openvmm-v%{version}/%{name}-%{version}-vendor.tar.gz + +# Upstream validates this configuration for x86_64-unknown-linux-gnu only. +ExclusiveArch: x86_64 + +BuildRequires: cargo-rpm-macros >= 25 +BuildRequires: rust >= 1.95.0 +BuildRequires: cargo >= 1.95.0 +BuildRequires: openssl-devel +BuildRequires: protobuf-compiler +# protoc resolves the well-known .proto imports from /usr/include. +BuildRequires: protobuf-devel + +%description +OpenVMM is a modular, cross-platform virtual machine monitor written in Rust. +This package provides the host binary, which runs virtual machines on Linux +via KVM or the Microsoft Hypervisor. + +%prep +%autosetup -n %{name}-openvmm-v%{version} -N +tar -xf %{SOURCE1} +# -N writes the build configuration without setting up a registry: the source +# replacements come from the cargo_config generated alongside the vendor tree, +# which also maps the git dependencies. +%cargo_prep -N +cat cargo_config >> .cargo/config.toml + +%build +# Link against the system OpenSSL rather than building a bundled copy. +export OPENSSL_NO_VENDOR=1 +%cargo_build -- --locked -p %{name} +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies +# Equivalent to %%cargo_vendor_manifest, minus "--no-dedupe". That flag expands +# every shared dependency at each point it is reached, which on a workspace this +# size grows without bound (over 10^8 lines and still growing after ten minutes). +# cargo2rpm collapses the output into a set, so suppressing the duplicates cannot +# change the result. The remaining transformations match write-vendor-manifest: +# drop the "(proc-macro)" annotation and the workspace's own crates, then sort. +# The subshell keeps %%cargo_vendor_manifest's "set -euo pipefail", so a failing +# "cargo tree" is not masked by the exit status of the trailing "sort". +( +set -euo pipefail +%{__cargo} tree --workspace --offline --edges=normal,build,dev --target=all \ + --all-features --prefix=none --format '{p}' \ + | sed -e 's/ (proc-macro)//' -e 's/ (\*)$//' -e '/^$/d' \ + | grep -vF "$PWD" | sort -u > cargo-vendor.txt +) + +%install +install -D -p -m 0755 target/rpm/%{name} %{buildroot}%{_bindir}/%{name} + +%check +target/rpm/%{name} --version + +%files +%license LICENSE +%license LICENSE.dependencies +%license cargo-vendor.txt +%doc README.md +%{_bindir}/%{name} + +%changelog +%autochangelog diff --git a/locks/openvmm.lock b/locks/openvmm.lock new file mode 100644 index 00000000000..7c4003a91cc --- /dev/null +++ b/locks/openvmm.lock @@ -0,0 +1,3 @@ +# Managed by azldev component update. Do not edit manually. +version = 1 +input-fingerprint = 'sha256:59cf8e9ff6e20d3c0fdf846bfb57f02e049a0a882261d15f264dd17410e0e27b' diff --git a/specs/o/openvmm/openvmm.spec b/specs/o/openvmm/openvmm.spec new file mode 100644 index 00000000000..b79122d7670 --- /dev/null +++ b/specs/o/openvmm/openvmm.spec @@ -0,0 +1,87 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.8.3) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# This spec file has been modified by azldev to include build configuration overlays. +# Do not edit manually; changes may be overwritten. + +Name: openvmm +Version: 0.1.0 +Release: %autorelease +Summary: Modular, cross-platform virtual machine monitor + +License: MIT +URL: https://github.com/microsoft/openvmm +Source0: %{url}/archive/openvmm-v%{version}/%{name}-%{version}.tar.gz +# Published with the release; contains the vendor tree and the cargo_config that +# maps the workspace's git dependencies into it. +Source1: %{url}/releases/download/openvmm-v%{version}/%{name}-%{version}-vendor.tar.gz + +# Upstream validates this configuration for x86_64-unknown-linux-gnu only. +ExclusiveArch: x86_64 + +BuildRequires: cargo-rpm-macros >= 25 +BuildRequires: rust >= 1.95.0 +BuildRequires: cargo >= 1.95.0 +BuildRequires: openssl-devel +BuildRequires: protobuf-compiler +# protoc resolves the well-known .proto imports from /usr/include. +BuildRequires: protobuf-devel + +%description +OpenVMM is a modular, cross-platform virtual machine monitor written in Rust. +This package provides the host binary, which runs virtual machines on Linux +via KVM or the Microsoft Hypervisor. + +%prep +%autosetup -n %{name}-openvmm-v%{version} -N +tar -xf %{SOURCE1} +# -N writes the build configuration without setting up a registry: the source +# replacements come from the cargo_config generated alongside the vendor tree, +# which also maps the git dependencies. +%cargo_prep -N +cat cargo_config >> .cargo/config.toml + +%build +# Link against the system OpenSSL rather than building a bundled copy. +export OPENSSL_NO_VENDOR=1 +%cargo_build -- --locked -p %{name} +%{cargo_license} > LICENSE.dependencies +# Equivalent to %%cargo_vendor_manifest, minus "--no-dedupe". That flag expands +# every shared dependency at each point it is reached, which on a workspace this +# size grows without bound (over 10^8 lines and still growing after ten minutes). +# cargo2rpm collapses the output into a set, so suppressing the duplicates cannot +# change the result. The remaining transformations match write-vendor-manifest: +# drop the "(proc-macro)" annotation and the workspace's own crates, then sort. +%{__cargo} tree --workspace --offline --edges=normal,build,dev --target=all \ + --all-features --prefix=none --format '{p}' \ + | sed -e 's/ (proc-macro)//' -e 's/ (\*)$//' -e '/^$/d' \ + | grep -vF "$PWD" | sort -u > cargo-vendor.txt + +%install +install -D -p -m 0755 target/rpm/%{name} %{buildroot}%{_bindir}/%{name} + +%check +target/rpm/%{name} --version + +%files +%license LICENSE +%license LICENSE.dependencies +%license cargo-vendor.txt +%doc README.md +%{_bindir}/%{name} + +%changelog +## START: Generated by rpmautospec +* Mon Aug 17 2026 Ben Hillis - 0.1.0-2 +- feat(openvmm): onboard OpenVMM to Azure Linux 4.0 + +* Thu Jan 01 1970 azldev <> - 0.1.0-1 +- Initial sources +## END: Generated by rpmautospec diff --git a/specs/o/openvmm/sources b/specs/o/openvmm/sources new file mode 100644 index 00000000000..75f43807e96 --- /dev/null +++ b/specs/o/openvmm/sources @@ -0,0 +1,2 @@ +SHA512 (openvmm-0.1.0.tar.gz) = 066c127e0f9b0e2fd34b5259b699688f8fed92d86f4b2d26c647057654568227aeb22de4d08ab1fc203f0b2f9a57144190bad778fc228d2ed456298a109c1f8b +SHA512 (openvmm-0.1.0-vendor.tar.gz) = 6ee0c42d2500808069c8083cb9340adc2fdf1ba01647679dbaa5350beb923454ec28405860afaa33f7a86676a20544cc32cc8385035babfdf3f9c44a6cc47ca1 From 532879dd911a45af5d9cef7b126e562a075ddfaa Mon Sep 17 00:00:00 2001 From: Ben Hillis Date: Wed, 2 Sep 2026 23:33:36 +0000 Subject: [PATCH 2/2] feat(openvmm): build for aarch64 and run unit tests Azure Linux 3.0 builds and validates this package on aarch64, so enable the same architecture here. The spec needs no other change: %cargo_build and target/rpm are already arch-agnostic. Also run a representative subset of the dependency closure's unit tests in %check rather than only invoking --version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- base/comps/openvmm/openvmm.spec | 8 ++++++-- locks/openvmm.lock | 2 +- specs/o/openvmm/openvmm.spec | 19 ++++++++++++++++--- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/base/comps/openvmm/openvmm.spec b/base/comps/openvmm/openvmm.spec index 323bcc75ef2..f9a6fe5d8b8 100644 --- a/base/comps/openvmm/openvmm.spec +++ b/base/comps/openvmm/openvmm.spec @@ -10,8 +10,7 @@ Source0: %{url}/archive/openvmm-v%{version}/%{name}-%{version}.tar.gz # maps the workspace's git dependencies into it. Source1: %{url}/releases/download/openvmm-v%{version}/%{name}-%{version}-vendor.tar.gz -# Upstream validates this configuration for x86_64-unknown-linux-gnu only. -ExclusiveArch: x86_64 +ExclusiveArch: x86_64 aarch64 BuildRequires: cargo-rpm-macros >= 25 BuildRequires: rust >= 1.95.0 @@ -26,6 +25,10 @@ OpenVMM is a modular, cross-platform virtual machine monitor written in Rust. This package provides the host binary, which runs virtual machines on Linux via KVM or the Microsoft Hypervisor. +# A representative subset of the openvmm binary's dependency closure whose unit +# tests need no live VM. Not exhaustive; more crates can be added over time. +%global test_crates -p acpi -p consomme -p crypto -p loader -p mesh_protobuf -p openvmm_core -p openvmm_entry -p pal -p pci_core -p vhdx -p vm_topology -p vmcore -p vmm_core + %prep %autosetup -n %{name}-openvmm-v%{version} -N tar -xf %{SOURCE1} @@ -61,6 +64,7 @@ set -euo pipefail install -D -p -m 0755 target/rpm/%{name} %{buildroot}%{_bindir}/%{name} %check +%cargo_test -- --locked --lib %{test_crates} target/rpm/%{name} --version %files diff --git a/locks/openvmm.lock b/locks/openvmm.lock index 7c4003a91cc..e5e2ecdf7ef 100644 --- a/locks/openvmm.lock +++ b/locks/openvmm.lock @@ -1,3 +1,3 @@ # Managed by azldev component update. Do not edit manually. version = 1 -input-fingerprint = 'sha256:59cf8e9ff6e20d3c0fdf846bfb57f02e049a0a882261d15f264dd17410e0e27b' +input-fingerprint = 'sha256:f2fa118a89557c6413ee87bb2d2426aaa23ef9692e48810cfbff23a902cf4893' diff --git a/specs/o/openvmm/openvmm.spec b/specs/o/openvmm/openvmm.spec index b79122d7670..9688257132c 100644 --- a/specs/o/openvmm/openvmm.spec +++ b/specs/o/openvmm/openvmm.spec @@ -2,7 +2,7 @@ ## (rpmautospec version 0.8.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: - release_number = 2; + release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} @@ -23,8 +23,7 @@ Source0: %{url}/archive/openvmm-v%{version}/%{name}-%{version}.tar.gz # maps the workspace's git dependencies into it. Source1: %{url}/releases/download/openvmm-v%{version}/%{name}-%{version}-vendor.tar.gz -# Upstream validates this configuration for x86_64-unknown-linux-gnu only. -ExclusiveArch: x86_64 +ExclusiveArch: x86_64 aarch64 BuildRequires: cargo-rpm-macros >= 25 BuildRequires: rust >= 1.95.0 @@ -39,6 +38,10 @@ OpenVMM is a modular, cross-platform virtual machine monitor written in Rust. This package provides the host binary, which runs virtual machines on Linux via KVM or the Microsoft Hypervisor. +# A representative subset of the openvmm binary's dependency closure whose unit +# tests need no live VM. Not exhaustive; more crates can be added over time. +%global test_crates -p acpi -p consomme -p crypto -p loader -p mesh_protobuf -p openvmm_core -p openvmm_entry -p pal -p pci_core -p vhdx -p vm_topology -p vmcore -p vmm_core + %prep %autosetup -n %{name}-openvmm-v%{version} -N tar -xf %{SOURCE1} @@ -52,6 +55,7 @@ cat cargo_config >> .cargo/config.toml # Link against the system OpenSSL rather than building a bundled copy. export OPENSSL_NO_VENDOR=1 %cargo_build -- --locked -p %{name} +%cargo_license_summary %{cargo_license} > LICENSE.dependencies # Equivalent to %%cargo_vendor_manifest, minus "--no-dedupe". That flag expands # every shared dependency at each point it is reached, which on a workspace this @@ -59,15 +63,21 @@ export OPENSSL_NO_VENDOR=1 # cargo2rpm collapses the output into a set, so suppressing the duplicates cannot # change the result. The remaining transformations match write-vendor-manifest: # drop the "(proc-macro)" annotation and the workspace's own crates, then sort. +# The subshell keeps %%cargo_vendor_manifest's "set -euo pipefail", so a failing +# "cargo tree" is not masked by the exit status of the trailing "sort". +( +set -euo pipefail %{__cargo} tree --workspace --offline --edges=normal,build,dev --target=all \ --all-features --prefix=none --format '{p}' \ | sed -e 's/ (proc-macro)//' -e 's/ (\*)$//' -e '/^$/d' \ | grep -vF "$PWD" | sort -u > cargo-vendor.txt +) %install install -D -p -m 0755 target/rpm/%{name} %{buildroot}%{_bindir}/%{name} %check +%cargo_test -- --locked --lib %{test_crates} target/rpm/%{name} --version %files @@ -79,6 +89,9 @@ target/rpm/%{name} --version %changelog ## START: Generated by rpmautospec +* Wed Sep 02 2026 Ben Hillis - 0.1.0-3 +- feat(openvmm): build for aarch64 and run unit tests + * Mon Aug 17 2026 Ben Hillis - 0.1.0-2 - feat(openvmm): onboard OpenVMM to Azure Linux 4.0