File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,6 +278,8 @@ The Nix test guest harness under `nix/test-guest` boots native-architecture clou
278278through QEMU for package, release, and E2E validation. A prepared cache entry is
279279captured after the exact ordered Ansible configuration list and before
280280test-specific packages, copied binaries, forwarded ports, or commands.
281+ On macOS, the test guest and tmachine paths use the same pinned QEMU and OVMF
282+ package set so the hypervisor and firmware remain compatible.
281283
282284Prepared disks are flattened, sanitized QCOW2 images. The local cache keeps them
283285read-only and each test receives a fresh writable overlay and cloud-init
Original file line number Diff line number Diff line change 4545 overlays = [ ( import rust-overlay ) ] ;
4646 } ;
4747 testGuestPkgs = import nixpkgs-test-guest { inherit system ; } ;
48+ tmachineRuntimePkgs = if pkgs . stdenv . hostPlatform . isDarwin then testGuestPkgs else pkgs ;
4849 commonDevShellPackages =
4950 with pkgs ;
5051 [
121122 qemuPkgs = testGuestPkgs ;
122123 firmwarePkgs = testGuestPkgs ;
123124 } ;
124- testMachines = import ./tests/config.nix { inherit pkgs toolchains ; } ;
125+ testMachines = import ./tests/config.nix {
126+ inherit pkgs toolchains ;
127+ qemuPkgs = tmachineRuntimePkgs ;
128+ firmwarePkgs = tmachineRuntimePkgs ;
129+ } ;
125130 artifacts = pkgs . callPackage ./tests/artifacts.nix { inherit rustToolchain toolchains ; } ;
126131 in
127132 {
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- { pkgs , toolchains } :
4+ {
5+ pkgs ,
6+ toolchains ,
7+ qemuPkgs ? pkgs ,
8+ firmwarePkgs ? pkgs ,
9+ } :
510
611let
712 isAarch64 = pkgs . stdenv . hostPlatform . isAarch64 ;
813 gnuTarget = toolchains . ${ if isAarch64 then "aarch64-gnu" else "x86_64-gnu" } . target ;
914 muslTarget = toolchains . ${ if isAarch64 then "aarch64-musl" else "x86_64-musl" } . target ;
10- images = import ./images.nix { inherit pkgs ; } ;
11- tmachine = pkgs . callPackage ./tmachine { } ;
15+ images = import ./images.nix {
16+ inherit pkgs qemuPkgs firmwarePkgs ;
17+ } ;
18+ tmachine = pkgs . callPackage ./tmachine {
19+ OVMF = firmwarePkgs . OVMF ;
20+ } ;
21+ qemu = qemuPkgs . qemu . override { hostCpuOnly = true ; } ;
1222 config = ( pkgs . formats . yaml { } ) . generate "tmachine-config.yaml" {
1323 machines = [
1424 {
98108 runner = pkgs . writeShellApplication {
99109 name = "tmachine" ;
100110 runtimeInputs = [
101- pkgs . qemu
111+ qemu
102112 pkgs . ansible
103113 pkgs . sshpass
104114 ] ;
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22# SPDX-License-Identifier: Apache-2.0
33
4- { pkgs } :
4+ {
5+ pkgs ,
6+ qemuPkgs ? pkgs ,
7+ firmwarePkgs ? pkgs ,
8+ } :
59
610let
711 isAarch64 = pkgs . stdenv . hostPlatform . isAarch64 ;
812 isDarwin = pkgs . stdenv . hostPlatform . isDarwin ;
913 architecture = if isAarch64 then "aarch64" else "x86_64" ;
1014 ubuntuArchitecture = if isAarch64 then "arm64" else "amd64" ;
11- qemu = pkgs . qemu . override { hostCpuOnly = true ; } ;
15+ qemu = qemuPkgs . qemu . override { hostCpuOnly = true ; } ;
1216 qemuBinary =
1317 if isAarch64 then "${ qemu } /bin/qemu-system-aarch64" else "${ qemu } /bin/qemu-system-x86_64" ;
1418 machine = if isAarch64 then "virt" else "q35" ;
3539 ]
3640 ++ pkgs . lib . optionals isAarch64 [
3741 "-drive"
38- "if=pflash,format=raw,readonly=on,file=${ pkgs . OVMF . firmware } "
42+ "if=pflash,format=raw,readonly=on,file=${ firmwarePkgs . OVMF . firmware } "
3943 "-drive"
4044 "if=pflash,format=raw,file=firmware-vars.fd"
4145 ]
7276 16G
7377
7478 ${ pkgs . lib . optionalString isAarch64 ''
75- cp ${ pkgs . OVMF . variables } firmware-vars.fd
79+ cp ${ firmwarePkgs . OVMF . variables } firmware-vars.fd
7680 chmod 0600 firmware-vars.fd
7781 '' }
7882
You can’t perform that action at this time.
0 commit comments