petri_artifacts_vmm_test/
lib.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! `petri` test artifacts used by in-tree VMM tests
5
6#![forbid(unsafe_code)]
7
8/// Artifact declarations
9pub mod artifacts {
10    use petri_artifacts_common::tags::IsVmgsTool;
11    use petri_artifacts_core::declare_artifacts;
12
13    macro_rules! openvmm_native {
14        ($id_ty:ty, $os:literal, $arch:literal) => {
15            /// openvmm "native" executable (i.e:
16            /// [`OPENVMM_WIN_X64`](const@OPENVMM_WIN_X64) when compiled on windows x86_64,
17            /// [`OPENVMM_LINUX_AARCH64`](const@OPENVMM_LINUX_AARCH64) when compiled on linux aarch64,
18            /// etc...)
19            // xtask-fmt allow-target-arch oneoff-petri-native-test-deps
20            #[cfg(all(target_os = $os, target_arch = $arch))]
21            pub const OPENVMM_NATIVE: petri_artifacts_core::ArtifactHandle<$id_ty> =
22                petri_artifacts_core::ArtifactHandle::new();
23        };
24    }
25
26    openvmm_native!(OPENVMM_WIN_X64, "windows", "x86_64");
27    openvmm_native!(OPENVMM_LINUX_X64, "linux", "x86_64");
28    openvmm_native!(OPENVMM_WIN_AARCH64, "windows", "aarch64");
29    openvmm_native!(OPENVMM_LINUX_AARCH64, "linux", "aarch64");
30    openvmm_native!(OPENVMM_MACOS_AARCH64, "macos", "aarch64");
31
32    declare_artifacts! {
33        /// openvmm windows x86_64 executable
34        OPENVMM_WIN_X64,
35        /// openvmm linux x86_64 executable
36        OPENVMM_LINUX_X64,
37        /// openvmm windows aarch64 executable
38        OPENVMM_WIN_AARCH64,
39        /// openvmm linux aarch64 executable
40        OPENVMM_LINUX_AARCH64,
41        /// openvmm macos aarch64 executable
42        OPENVMM_MACOS_AARCH64,
43    }
44
45    /// Guest-side tools used by the VMM tests.
46    pub mod guest_tools {
47        use petri_artifacts_core::declare_artifacts;
48
49        declare_artifacts! {
50            /// Windows x86_64 build of the `tpm_guest_tests` utility.
51            TPM_GUEST_TESTS_WINDOWS_X64,
52            /// Linux x86_64 build of the `tpm_guest_tests` utility.
53            TPM_GUEST_TESTS_LINUX_X64,
54        }
55    }
56
57    /// Loadable artifacts
58    pub mod loadable {
59        use petri_artifacts_common::tags::IsLoadable;
60        use petri_artifacts_common::tags::MachineArch;
61        use petri_artifacts_core::declare_artifacts;
62
63        macro_rules! linux_direct_native {
64            ($id_kernel_ty:ty, $id_initrd_ty:ty, $arch:literal) => {
65                /// Test linux direct kernel (from OpenVMM deps) for the target architecture
66                // xtask-fmt allow-target-arch oneoff-petri-native-test-deps
67                #[cfg(target_arch = $arch)]
68                pub const LINUX_DIRECT_TEST_KERNEL_NATIVE: petri_artifacts_core::ArtifactHandle<
69                    $id_kernel_ty,
70                > = petri_artifacts_core::ArtifactHandle::new();
71                /// Test linux direct initrd (from OpenVMM deps) for the target architecture
72                // xtask-fmt allow-target-arch oneoff-petri-native-test-deps
73                #[cfg(target_arch = $arch)]
74                pub const LINUX_DIRECT_TEST_INITRD_NATIVE: petri_artifacts_core::ArtifactHandle<
75                    $id_initrd_ty,
76                > = petri_artifacts_core::ArtifactHandle::new();
77            };
78        }
79
80        linux_direct_native!(
81            LINUX_DIRECT_TEST_KERNEL_X64,
82            LINUX_DIRECT_TEST_INITRD_X64,
83            "x86_64"
84        );
85        linux_direct_native!(
86            LINUX_DIRECT_TEST_KERNEL_AARCH64,
87            LINUX_DIRECT_TEST_INITRD_AARCH64,
88            "aarch64"
89        );
90
91        declare_artifacts! {
92            /// Test linux direct kernel (from OpenVMM deps)
93            LINUX_DIRECT_TEST_KERNEL_X64,
94            /// Test linux direct initrd (from OpenVMM deps)
95            LINUX_DIRECT_TEST_INITRD_X64,
96            /// Test linux direct kernel (from OpenVMM deps)
97            LINUX_DIRECT_TEST_KERNEL_AARCH64,
98            /// Test linux direct initrd (from OpenVMM deps)
99            LINUX_DIRECT_TEST_INITRD_AARCH64,
100            /// PCAT firmware DLL
101            PCAT_FIRMWARE_X64,
102            /// SVGA firmware DLL
103            SVGA_FIRMWARE_X64,
104            /// UEFI firmware for x64
105            UEFI_FIRMWARE_X64,
106            /// UEFI firmware for aarch64
107            UEFI_FIRMWARE_AARCH64,
108        }
109
110        impl IsLoadable for LINUX_DIRECT_TEST_KERNEL_X64 {
111            const ARCH: MachineArch = MachineArch::X86_64;
112        }
113
114        impl IsLoadable for LINUX_DIRECT_TEST_INITRD_X64 {
115            const ARCH: MachineArch = MachineArch::X86_64;
116        }
117
118        impl IsLoadable for LINUX_DIRECT_TEST_KERNEL_AARCH64 {
119            const ARCH: MachineArch = MachineArch::Aarch64;
120        }
121
122        impl IsLoadable for LINUX_DIRECT_TEST_INITRD_AARCH64 {
123            const ARCH: MachineArch = MachineArch::Aarch64;
124        }
125
126        impl IsLoadable for PCAT_FIRMWARE_X64 {
127            const ARCH: MachineArch = MachineArch::X86_64;
128        }
129
130        impl IsLoadable for SVGA_FIRMWARE_X64 {
131            const ARCH: MachineArch = MachineArch::X86_64;
132        }
133
134        impl IsLoadable for UEFI_FIRMWARE_X64 {
135            const ARCH: MachineArch = MachineArch::X86_64;
136        }
137
138        impl IsLoadable for UEFI_FIRMWARE_AARCH64 {
139            const ARCH: MachineArch = MachineArch::Aarch64;
140        }
141    }
142
143    /// OpenHCL IGVM artifacts
144    pub mod openhcl_igvm {
145        use petri_artifacts_common::tags::IsLoadable;
146        use petri_artifacts_common::tags::IsOpenhclIgvm;
147        use petri_artifacts_common::tags::MachineArch;
148        use petri_artifacts_core::declare_artifacts;
149
150        declare_artifacts! {
151            /// OpenHCL IGVM (standard)
152            LATEST_STANDARD_X64,
153            /// OpenHCL IGVM last release (standard)
154            LATEST_RELEASE_STANDARD_X64,
155            /// OpenHCL IGVM (standard, with VTL2 dev kernel)
156            LATEST_STANDARD_DEV_KERNEL_X64,
157            /// OpenHCL IGVM (for CVM)
158            LATEST_CVM_X64,
159            /// OpenHCL IGVM (using a linux direct-boot test image instead of UEFI)
160            LATEST_LINUX_DIRECT_TEST_X64,
161            /// OpenHCL IGVM last release (using a linux direct-boot test image instead of UEFI)
162            LATEST_RELEASE_LINUX_DIRECT_X64,
163            /// OpenHCL IGVM (standard AARCH64)
164            LATEST_STANDARD_AARCH64,
165            /// OpenHCL IGVM last release (standard AARCH64)
166            LATEST_RELEASE_STANDARD_AARCH64,
167            /// OpenHCL IGVM (standard AARCH64, with VTL2 dev kernel)
168            LATEST_STANDARD_DEV_KERNEL_AARCH64,
169        }
170
171        impl IsLoadable for LATEST_STANDARD_X64 {
172            const ARCH: MachineArch = MachineArch::X86_64;
173        }
174        impl IsOpenhclIgvm for LATEST_STANDARD_X64 {}
175
176        impl IsLoadable for LATEST_RELEASE_STANDARD_X64 {
177            const ARCH: MachineArch = MachineArch::X86_64;
178        }
179        impl IsOpenhclIgvm for LATEST_RELEASE_STANDARD_X64 {}
180
181        impl IsLoadable for LATEST_STANDARD_DEV_KERNEL_X64 {
182            const ARCH: MachineArch = MachineArch::X86_64;
183        }
184        impl IsOpenhclIgvm for LATEST_STANDARD_DEV_KERNEL_X64 {}
185
186        impl IsLoadable for LATEST_CVM_X64 {
187            const ARCH: MachineArch = MachineArch::X86_64;
188        }
189        impl IsOpenhclIgvm for LATEST_CVM_X64 {}
190
191        impl IsLoadable for LATEST_LINUX_DIRECT_TEST_X64 {
192            const ARCH: MachineArch = MachineArch::X86_64;
193        }
194        impl IsOpenhclIgvm for LATEST_LINUX_DIRECT_TEST_X64 {}
195
196        impl IsLoadable for LATEST_RELEASE_LINUX_DIRECT_X64 {
197            const ARCH: MachineArch = MachineArch::X86_64;
198        }
199        impl IsOpenhclIgvm for LATEST_RELEASE_LINUX_DIRECT_X64 {}
200
201        impl IsLoadable for LATEST_STANDARD_AARCH64 {
202            const ARCH: MachineArch = MachineArch::Aarch64;
203        }
204        impl IsOpenhclIgvm for LATEST_STANDARD_AARCH64 {}
205
206        impl IsLoadable for LATEST_RELEASE_STANDARD_AARCH64 {
207            const ARCH: MachineArch = MachineArch::Aarch64;
208        }
209        impl IsOpenhclIgvm for LATEST_RELEASE_STANDARD_AARCH64 {}
210
211        impl IsLoadable for LATEST_STANDARD_DEV_KERNEL_AARCH64 {
212            const ARCH: MachineArch = MachineArch::Aarch64;
213        }
214        impl IsOpenhclIgvm for LATEST_STANDARD_DEV_KERNEL_AARCH64 {}
215
216        /// OpenHCL usermode binary
217        pub mod um_bin {
218            use petri_artifacts_core::declare_artifacts;
219
220            declare_artifacts! {
221                /// Usermode binary for Linux direct
222                LATEST_LINUX_DIRECT_TEST_X64
223            }
224        }
225
226        /// OpenHCL debugging symbols for the usermode binary
227        pub mod um_dbg {
228            use petri_artifacts_core::declare_artifacts;
229
230            declare_artifacts! {
231                /// Usermode symbols for Linux direct
232                LATEST_LINUX_DIRECT_TEST_X64
233            }
234        }
235    }
236
237    /// Test VHD artifacts
238    pub mod test_vhd {
239        use crate::tags::IsHostedOnHvliteAzureBlobStore;
240        use petri_artifacts_common::tags::GuestQuirks;
241        use petri_artifacts_common::tags::GuestQuirksInner;
242        use petri_artifacts_common::tags::InitialRebootCondition;
243        use petri_artifacts_common::tags::IsTestVhd;
244        use petri_artifacts_common::tags::MachineArch;
245        use petri_artifacts_common::tags::OsFlavor;
246        use petri_artifacts_core::declare_artifacts;
247
248        declare_artifacts! {
249            /// guest_test_uefi.img, built for x86_64 from the in-tree `guest_test_uefi` codebase.
250            GUEST_TEST_UEFI_X64,
251            /// guest_test_uefi.img, built for aarch64 from the in-tree `guest_test_uefi` codebase.
252            GUEST_TEST_UEFI_AARCH64,
253        }
254
255        impl IsTestVhd for GUEST_TEST_UEFI_X64 {
256            const OS_FLAVOR: OsFlavor = OsFlavor::Uefi;
257            const ARCH: MachineArch = MachineArch::X86_64;
258        }
259
260        impl IsTestVhd for GUEST_TEST_UEFI_AARCH64 {
261            const OS_FLAVOR: OsFlavor = OsFlavor::Uefi;
262            const ARCH: MachineArch = MachineArch::Aarch64;
263        }
264
265        // NOTE: GUEST_TEST_UEFI is not hosted on the HvLite Azure Blob Store. It is
266        // built just-in-time, using the code that is present in-tree, under
267        // `guest_test_uefi`.
268
269        declare_artifacts! {
270            /// Generation 1 windows test image
271            GEN1_WINDOWS_DATA_CENTER_CORE2022_X64
272        }
273
274        impl IsTestVhd for GEN1_WINDOWS_DATA_CENTER_CORE2022_X64 {
275            const OS_FLAVOR: OsFlavor = OsFlavor::Windows;
276            const ARCH: MachineArch = MachineArch::X86_64;
277        }
278
279        impl IsHostedOnHvliteAzureBlobStore for GEN1_WINDOWS_DATA_CENTER_CORE2022_X64 {
280            const FILENAME: &'static str =
281                "WindowsServer-2022-datacenter-core-smalldisk-20348.1906.230803.vhd";
282            const SIZE: u64 = 32214352384;
283        }
284
285        declare_artifacts! {
286            /// Generation 2 windows test image
287            GEN2_WINDOWS_DATA_CENTER_CORE2022_X64
288        }
289
290        impl IsTestVhd for GEN2_WINDOWS_DATA_CENTER_CORE2022_X64 {
291            const OS_FLAVOR: OsFlavor = OsFlavor::Windows;
292            const ARCH: MachineArch = MachineArch::X86_64;
293        }
294
295        impl IsHostedOnHvliteAzureBlobStore for GEN2_WINDOWS_DATA_CENTER_CORE2022_X64 {
296            const FILENAME: &'static str =
297                "WindowsServer-2022-datacenter-core-smalldisk-g2-20348.1906.230803.vhd";
298            const SIZE: u64 = 32214352384;
299        }
300
301        declare_artifacts! {
302            /// Generation 2 windows test image
303            GEN2_WINDOWS_DATA_CENTER_CORE2025_X64
304        }
305
306        impl IsTestVhd for GEN2_WINDOWS_DATA_CENTER_CORE2025_X64 {
307            const OS_FLAVOR: OsFlavor = OsFlavor::Windows;
308            const ARCH: MachineArch = MachineArch::X86_64;
309
310            fn quirks() -> GuestQuirks {
311                GuestQuirks::for_all_backends(GuestQuirksInner {
312                    initial_reboot: Some(InitialRebootCondition::Always),
313                    ..Default::default()
314                })
315            }
316        }
317
318        impl IsHostedOnHvliteAzureBlobStore for GEN2_WINDOWS_DATA_CENTER_CORE2025_X64 {
319            const FILENAME: &'static str =
320                "WindowsServer-2025-datacenter-core-smalldisk-g2-26100.3476.250306.vhd";
321            const SIZE: u64 = 32214352384;
322        }
323
324        declare_artifacts! {
325            /// FreeBSD 13.2
326            FREE_BSD_13_2_X64
327        }
328
329        impl IsTestVhd for FREE_BSD_13_2_X64 {
330            const OS_FLAVOR: OsFlavor = OsFlavor::FreeBsd;
331            const ARCH: MachineArch = MachineArch::X86_64;
332
333            fn quirks() -> GuestQuirks {
334                GuestQuirks::for_all_backends(GuestQuirksInner {
335                    hyperv_shutdown_ic_sleep: Some(std::time::Duration::from_secs(20)),
336                    ..Default::default()
337                })
338            }
339        }
340
341        impl IsHostedOnHvliteAzureBlobStore for FREE_BSD_13_2_X64 {
342            const FILENAME: &'static str = "FreeBSD-13.2-RELEASE-amd64.vhd";
343            const SIZE: u64 = 6477005312;
344        }
345
346        declare_artifacts! {
347            /// Ubuntu 24.04 Server X64
348            UBUNTU_2404_SERVER_X64
349        }
350
351        impl IsTestVhd for UBUNTU_2404_SERVER_X64 {
352            const OS_FLAVOR: OsFlavor = OsFlavor::Linux;
353            const ARCH: MachineArch = MachineArch::X86_64;
354            fn quirks() -> GuestQuirks {
355                GuestQuirks::for_all_backends(GuestQuirksInner {
356                    hyperv_shutdown_ic_sleep: Some(std::time::Duration::from_secs(20)),
357                    initial_reboot: Some(InitialRebootCondition::WithTpm),
358                })
359            }
360        }
361
362        impl IsHostedOnHvliteAzureBlobStore for UBUNTU_2404_SERVER_X64 {
363            const FILENAME: &'static str = "ubuntu-24.04-server-cloudimg-amd64.vhd";
364            const SIZE: u64 = 3758211584;
365        }
366
367        declare_artifacts! {
368            /// Ubuntu 25.04 Server X64
369            UBUNTU_2504_SERVER_X64
370        }
371
372        impl IsTestVhd for UBUNTU_2504_SERVER_X64 {
373            const OS_FLAVOR: OsFlavor = OsFlavor::Linux;
374            const ARCH: MachineArch = MachineArch::X86_64;
375            fn quirks() -> GuestQuirks {
376                GuestQuirks::for_all_backends(GuestQuirksInner {
377                    hyperv_shutdown_ic_sleep: Some(std::time::Duration::from_secs(20)),
378                    initial_reboot: Some(InitialRebootCondition::WithTpm),
379                })
380            }
381        }
382
383        impl IsHostedOnHvliteAzureBlobStore for UBUNTU_2504_SERVER_X64 {
384            const FILENAME: &'static str = "ubuntu-25.04-server-cloudimg-amd64.vhd";
385            const SIZE: u64 = 3758211584;
386        }
387
388        declare_artifacts! {
389            /// Ubuntu 24.04 Server Aarch64
390            UBUNTU_2404_SERVER_AARCH64
391        }
392
393        impl IsTestVhd for UBUNTU_2404_SERVER_AARCH64 {
394            const OS_FLAVOR: OsFlavor = OsFlavor::Linux;
395            const ARCH: MachineArch = MachineArch::Aarch64;
396            fn quirks() -> GuestQuirks {
397                GuestQuirks::for_all_backends(GuestQuirksInner {
398                    hyperv_shutdown_ic_sleep: Some(std::time::Duration::from_secs(20)),
399                    initial_reboot: Some(InitialRebootCondition::WithTpm),
400                })
401            }
402        }
403
404        impl IsHostedOnHvliteAzureBlobStore for UBUNTU_2404_SERVER_AARCH64 {
405            const FILENAME: &'static str = "ubuntu-24.04-server-cloudimg-arm64.vhd";
406            const SIZE: u64 = 3758211584;
407        }
408
409        declare_artifacts! {
410            /// Windows 11 Enterprise ARM64 24H2
411            WINDOWS_11_ENTERPRISE_AARCH64
412        }
413
414        impl IsTestVhd for WINDOWS_11_ENTERPRISE_AARCH64 {
415            const OS_FLAVOR: OsFlavor = OsFlavor::Windows;
416            const ARCH: MachineArch = MachineArch::Aarch64;
417
418            fn quirks() -> GuestQuirks {
419                GuestQuirks::for_all_backends(GuestQuirksInner {
420                    initial_reboot: Some(InitialRebootCondition::Always),
421                    ..Default::default()
422                })
423            }
424        }
425
426        impl IsHostedOnHvliteAzureBlobStore for WINDOWS_11_ENTERPRISE_AARCH64 {
427            const FILENAME: &'static str =
428                "windows11preview-arm64-win11-24h2-ent-26100.3775.250406-1.vhdx";
429            const SIZE: u64 = 24398266368;
430        }
431
432        // VHDs that are created by pre-preparation automation
433
434        declare_artifacts! {
435            /// Generation 2 windows test image
436            GEN2_WINDOWS_DATA_CENTER_CORE2025_X64_PREPPED
437        }
438
439        impl IsTestVhd for GEN2_WINDOWS_DATA_CENTER_CORE2025_X64_PREPPED {
440            const OS_FLAVOR: OsFlavor = GEN2_WINDOWS_DATA_CENTER_CORE2025_X64::OS_FLAVOR;
441            const ARCH: MachineArch = GEN2_WINDOWS_DATA_CENTER_CORE2025_X64::ARCH;
442
443            fn quirks() -> GuestQuirks {
444                GEN2_WINDOWS_DATA_CENTER_CORE2025_X64::quirks()
445            }
446        }
447    }
448
449    /// Test ISO artifacts
450    pub mod test_iso {
451        use crate::tags::IsHostedOnHvliteAzureBlobStore;
452        use petri_artifacts_common::tags::GuestQuirks;
453        use petri_artifacts_common::tags::GuestQuirksInner;
454        use petri_artifacts_common::tags::IsTestIso;
455        use petri_artifacts_common::tags::MachineArch;
456        use petri_artifacts_common::tags::OsFlavor;
457        use petri_artifacts_core::declare_artifacts;
458
459        declare_artifacts! {
460            /// FreeBSD 13.2
461            FREE_BSD_13_2_X64
462        }
463
464        impl IsTestIso for FREE_BSD_13_2_X64 {
465            const OS_FLAVOR: OsFlavor = OsFlavor::FreeBsd;
466            const ARCH: MachineArch = MachineArch::X86_64;
467
468            fn quirks() -> GuestQuirks {
469                GuestQuirks::for_all_backends(GuestQuirksInner {
470                    hyperv_shutdown_ic_sleep: Some(std::time::Duration::from_secs(20)),
471                    ..Default::default()
472                })
473            }
474        }
475
476        impl IsHostedOnHvliteAzureBlobStore for FREE_BSD_13_2_X64 {
477            const FILENAME: &'static str = "FreeBSD-13.2-RELEASE-amd64-dvd1.iso";
478            const SIZE: u64 = 4245487616;
479        }
480    }
481
482    /// Test VMGS artifacts
483    pub mod test_vmgs {
484        use crate::tags::IsHostedOnHvliteAzureBlobStore;
485        use petri_artifacts_common::tags::IsTestVmgs;
486        use petri_artifacts_core::declare_artifacts;
487
488        declare_artifacts! {
489            /// VMGS file containing a UEFI boot entry
490            ///
491            /// The file was generated by booting an arbitrary Windows VHD
492            /// (different from the ones used for testing in CI) in OpenVMM
493            /// with a persistent VMGS file enabled. This is useful for testing
494            /// whether default_boot_always_attempt works to boot other VHDs.
495            VMGS_WITH_BOOT_ENTRY,
496        }
497
498        impl IsHostedOnHvliteAzureBlobStore for VMGS_WITH_BOOT_ENTRY {
499            const FILENAME: &'static str = "sample-vmgs.vhd";
500            const SIZE: u64 = 4194816;
501        }
502
503        impl IsTestVmgs for VMGS_WITH_BOOT_ENTRY {}
504    }
505
506    /// TMK-related artifacts
507    pub mod tmks {
508        use petri_artifacts_core::declare_artifacts;
509
510        macro_rules! tmk_native {
511            ($id_ty:ty, $os:literal, $arch:literal) => {
512                /// tmk_vmm "native" executable
513                // xtask-fmt allow-target-arch oneoff-petri-native-test-deps
514                #[cfg(all(target_os = $os, target_arch = $arch))]
515                pub const TMK_VMM_NATIVE: petri_artifacts_core::ArtifactHandle<$id_ty> =
516                    petri_artifacts_core::ArtifactHandle::new();
517            };
518        }
519
520        tmk_native!(TMK_VMM_WIN_X64, "windows", "x86_64");
521        tmk_native!(TMK_VMM_LINUX_X64, "linux", "x86_64");
522        tmk_native!(TMK_VMM_WIN_AARCH64, "windows", "aarch64");
523        tmk_native!(TMK_VMM_LINUX_AARCH64, "linux", "aarch64");
524        tmk_native!(TMK_VMM_MACOS_AARCH64, "macos", "aarch64");
525
526        declare_artifacts! {
527            /// TMK VMM for Windows x64
528            TMK_VMM_WIN_X64,
529            /// TMK VMM for Linux x64
530            TMK_VMM_LINUX_X64,
531            /// TMK VMM for MacOS x64
532            TMK_VMM_WIN_AARCH64,
533            /// TMK VMM for Linux aarch64
534            TMK_VMM_LINUX_AARCH64,
535            /// TMK VMM for MacOS aarch64
536            TMK_VMM_MACOS_AARCH64,
537            /// TMK VMM for Linux musl x64
538            TMK_VMM_LINUX_X64_MUSL,
539            /// TMK VMM for Linux musl aarch64
540            TMK_VMM_LINUX_AARCH64_MUSL,
541            /// TMK binary for x64
542            SIMPLE_TMK_X64,
543            /// TMK binary for aarch64
544            SIMPLE_TMK_AARCH64,
545        }
546    }
547
548    macro_rules! vmgstool_native {
549        ($id_ty:ty, $os:literal, $arch:literal) => {
550            /// vmgstool "native" executable (i.e:
551            /// [`VMGSTOOL_WIN_X64`](const@VMGSTOOL_WIN_X64) when compiled on windows x86_64,
552            /// [`VMGSTOOL_LINUX_AARCH64`](const@VMGSTOOL_LINUX_AARCH64) when compiled on linux aarch64,
553            /// etc...)
554            // xtask-fmt allow-target-arch oneoff-petri-native-test-deps
555            #[cfg(all(target_os = $os, target_arch = $arch))]
556            pub const VMGSTOOL_NATIVE: petri_artifacts_core::ArtifactHandle<$id_ty> =
557                petri_artifacts_core::ArtifactHandle::new();
558        };
559    }
560
561    vmgstool_native!(VMGSTOOL_WIN_X64, "windows", "x86_64");
562    vmgstool_native!(VMGSTOOL_LINUX_X64, "linux", "x86_64");
563    vmgstool_native!(VMGSTOOL_WIN_AARCH64, "windows", "aarch64");
564    vmgstool_native!(VMGSTOOL_LINUX_AARCH64, "linux", "aarch64");
565    vmgstool_native!(VMGSTOOL_MACOS_AARCH64, "macos", "aarch64");
566
567    declare_artifacts! {
568        /// vmgstool windows x86_64 executable
569        VMGSTOOL_WIN_X64,
570        /// vmgstool linux x86_64 executable
571        VMGSTOOL_LINUX_X64,
572        /// vmgstool windows aarch64 executable
573        VMGSTOOL_WIN_AARCH64,
574        /// vmgstool linux aarch64 executable
575        VMGSTOOL_LINUX_AARCH64,
576        /// vmgstool linux aarch64 executable
577        VMGSTOOL_MACOS_AARCH64,
578    }
579
580    impl IsVmgsTool for VMGSTOOL_WIN_X64 {}
581    impl IsVmgsTool for VMGSTOOL_LINUX_X64 {}
582    impl IsVmgsTool for VMGSTOOL_WIN_AARCH64 {}
583    impl IsVmgsTool for VMGSTOOL_LINUX_AARCH64 {}
584    impl IsVmgsTool for VMGSTOOL_MACOS_AARCH64 {}
585}
586
587/// Artifact tag trait declarations
588pub mod tags {
589    use petri_artifacts_core::ArtifactId;
590
591    /// Artifact is associated with a file hosted in HvLite's microsoft-internal
592    /// Azure Blob Store.
593    pub trait IsHostedOnHvliteAzureBlobStore: ArtifactId {
594        /// Filename in the blob store
595        const FILENAME: &'static str;
596        /// Size of the file in bytes
597        const SIZE: u64;
598    }
599}