Skip to content

flowey/resolve_openvmm_deps: unify dep file handling and add petritools erofs#3154

Open
jstarks wants to merge 1 commit intomicrosoft:mainfrom
jstarks:erofs
Open

flowey/resolve_openvmm_deps: unify dep file handling and add petritools erofs#3154
jstarks wants to merge 1 commit intomicrosoft:mainfrom
jstarks:erofs

Conversation

@jstarks
Copy link
Copy Markdown
Member

@jstarks jstarks commented Mar 29, 2026

Replace the per-file request variants (GetLinuxTestKernel, GetLinuxTestInitrd, GetOpenhclCpioDbgrd, GetOpenhclCpioShell, GetOpenhclSysroot) in resolve_openvmm_deps with a single Get(OpenvmmDepFile, arch, var) variant backed by an OpenvmmDepFile enum. This collapses the repetitive per-file matching in both the local-path and download-and-extract code paths into a single loop over the enum.

Replace init_openvmm_magicpath_linux_test_kernel (which was specific to the test kernel and initrd) with a generic init_openvmm_magicpath_openvmm_deps module that copies any set of dep files to the magicpath using a declarative table. Adding a new dep file now only requires adding an entry to dep_files().

Use this to wire up the new petritools erofs image: add PETRITOOLS_EROFS_X64 and PETRITOOLS_EROFS_AARCH64 artifact declarations, resolver paths, and the dep file entry. Fix a duplicate-artifact panic in petri_artifacts_core by deduplicating handles during resolution.

Bump openvmm-deps to 0.1.0-20260328.1.

…ls erofs

Replace the per-file request variants (GetLinuxTestKernel, GetLinuxTestInitrd,
GetOpenhclCpioDbgrd, GetOpenhclCpioShell, GetOpenhclSysroot) in
resolve_openvmm_deps with a single Get(OpenvmmDepFile, arch, var) variant
backed by an OpenvmmDepFile enum. This collapses the repetitive per-file
matching in both the local-path and download-and-extract code paths into a
single loop over the enum.

Replace init_openvmm_magicpath_linux_test_kernel (which was specific to the
test kernel and initrd) with a generic init_openvmm_magicpath_openvmm_deps
module that copies any set of dep files to the magicpath using a declarative
table. Adding a new dep file now only requires adding an entry to dep_files().

Use this to wire up the new petritools erofs image: add PETRITOOLS_EROFS_X64
and PETRITOOLS_EROFS_AARCH64 artifact declarations, resolver paths, and the
dep file entry. Fix a duplicate-artifact panic in petri_artifacts_core by
deduplicating handles during resolution.

Bump openvmm-deps to 0.1.0-20260328.1.
@jstarks jstarks requested a review from a team as a code owner March 29, 2026 06:43
Copilot AI review requested due to automatic review settings March 29, 2026 06:43
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 refactors how openvmm-deps artifacts are requested/resolved in Flowey by unifying per-file request variants into a single Get(OpenvmmDepFile, arch, var) mechanism, adds new Petritools EROFS artifacts (x64/aarch64) to the Petri test artifact system, and updates dependency handling to avoid duplicate-artifact resolution panics.

Changes:

  • Replace multiple resolve_openvmm_deps request variants with a single Get request backed by an OpenvmmDepFile enum.
  • Introduce a generic “copy openvmm-deps files to magicpath” node and wire it into local package restore flows; remove the linux-test-kernel-specific node.
  • Add Petritools EROFS artifact declarations + resolver paths, dedupe artifact handles during resolution, and bump OPENVMM_DEPS version.

Reviewed changes

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

Show a summary per file
File Description
vmm_tests/petri_artifacts_vmm_test/src/lib.rs Declares new Petritools EROFS test artifacts (x64/aarch64).
vmm_tests/petri_artifact_resolver_openvmm_known_paths/src/lib.rs Adds known-path + bundle-name resolution for Petritools EROFS images.
petri/petri_artifacts_core/src/lib.rs Deduplicates artifact handles during requirements resolution to prevent duplicate-panics.
flowey/flowey_lib_hvlite/src/resolve_openvmm_deps.rs Unifies dep file resolution via OpenvmmDepFile + single Get request variant; simplifies download/extract logic.
flowey/flowey_lib_hvlite/src/lib.rs Switches exported module from the old linux-test-kernel magicpath node to the new generic openvmm-deps node.
flowey/flowey_lib_hvlite/src/init_vmm_tests_env.rs Updates callers to use Request::Get(OpenvmmDepFile, ...).
flowey/flowey_lib_hvlite/src/init_openvmm_magicpath_openvmm_deps.rs New node that copies a declarative set of openvmm-deps files into the magicpath.
flowey/flowey_lib_hvlite/src/init_openvmm_magicpath_openhcl_sysroot.rs Updates sysroot dep resolution to the new Request::Get API.
flowey/flowey_lib_hvlite/src/init_openvmm_magicpath_linux_test_kernel.rs Removes the old linux-test-kernel/initrd-specific magicpath node.
flowey/flowey_lib_hvlite/src/build_openhcl_initrd.rs Updates OpenHCL cpio dep resolution to the new Request::Get API.
flowey/flowey_lib_hvlite/src/build_openhcl_igvm_from_recipe.rs Updates example kernel/initrd dep resolution to the new Request::Get API.
flowey/flowey_lib_hvlite/src/_jobs/local_restore_packages.rs Wires local restore to run the new openvmm-deps magicpath initializer per-arch.
flowey/flowey_lib_hvlite/src/_jobs/cfg_versions.rs Bumps OPENVMM_DEPS version string to 0.1.0-20260328.1.

Comment on lines +347 to +355
let mut seen = HashSet::new();
let mut resolved = HashMap::new();

for &(a, optional) in &self.artifacts {
// Skip duplicates — the same artifact may be registered by
// multiple tests.
if !seen.insert(a) {
continue;
}
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

Deduplicating by ErasedArtifactHandle alone can change required/optional semantics: if the same artifact is added both as optional and required, and the optional entry appears first, the required one will be skipped and a missing artifact won’t be reported as an error. Consider merging duplicates by keeping the strictest requirement (treat as required if any registration is required), then resolve each unique artifact once using that merged optional flag.

Suggested change
let mut seen = HashSet::new();
let mut resolved = HashMap::new();
for &(a, optional) in &self.artifacts {
// Skip duplicates — the same artifact may be registered by
// multiple tests.
if !seen.insert(a) {
continue;
}
let mut resolved = HashMap::new();
// Merge duplicate registrations by handle, keeping the strictest
// requirement (treat as required if any registration is required).
let mut merged: HashMap<ErasedArtifactHandle, bool> = HashMap::new();
for &(a, optional) in &self.artifacts {
merged
.entry(a)
.and_modify(|existing_optional| {
// `optional == true` means optional; `false` means required.
// We want the strictest semantics: required if any registration is required.
*existing_optional = *existing_optional && optional;
})
.or_insert(optional);
}
for (a, optional) in merged {

Copilot uses AI. Check for mistakes.
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