Skip to content

Commit d8482d7

Browse files
Merge pull request #1884 from rust-osdev/revert-1876-fix-ci
Revert "ci/fix: upgrade QEMU on windows"
2 parents c417fbc + 98f0d5c commit d8482d7

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
runs-on: windows-latest
6666
steps:
6767
- name: Install QEMU
68-
run: choco install qemu --version 2025.12.24
68+
run: choco install qemu --version 2023.4.24
6969
- name: Checkout sources
7070
uses: actions/checkout@v6
7171
- uses: Swatinem/rust-cache@v2

xtask/src/qemu.rs

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -312,38 +312,20 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
312312
UefiArch::AArch64 => "qemu-system-aarch64",
313313
UefiArch::IA32 | UefiArch::X86_64 => "qemu-system-x86_64",
314314
};
315+
let mut cmd = Command::new(qemu_exe);
315316

316-
// The QEMU installer for Windows does not automatically add the
317-
// directory containing the QEMU executables to the PATH. Add
318-
// the default directory to the PATH to make it more likely that
319-
// QEMU will be found on Windows. (The directory is appended, so
320-
// if a different directory on the PATH already has the QEMU
321-
// binary this change won't affect anything.)
322-
let fn_append_win_path = |cmd: &mut Command| {
317+
if platform::is_windows() {
318+
// The QEMU installer for Windows does not automatically add the
319+
// directory containing the QEMU executables to the PATH. Add
320+
// the default directory to the PATH to make it more likely that
321+
// QEMU will be found on Windows. (The directory is appended, so
322+
// if a different directory on the PATH already has the QEMU
323+
// binary this change won't affect anything.)
323324
let mut path = env::var_os("PATH").unwrap_or_default();
324325
path.push(r";C:\Program Files\qemu");
325326
cmd.env("PATH", path);
326-
};
327-
328-
// Print the QEMU version
329-
{
330-
let mut cmd = Command::new(qemu_exe);
331-
if platform::is_windows() {
332-
fn_append_win_path(&mut cmd)
333-
};
334-
cmd.arg("--version");
335-
let output = cmd.output()?;
336-
eprintln!("QEMU:");
337-
eprintln!(" binary : {qemu_exe}");
338-
eprintln!(" version: {}", String::from_utf8(output.stdout)?);
339327
}
340328

341-
// Construct the actual QEMU argument
342-
let mut cmd = Command::new(qemu_exe);
343-
if platform::is_windows() {
344-
fn_append_win_path(&mut cmd)
345-
};
346-
347329
// Disable default devices.
348330
// QEMU by defaults enables a ton of devices which slow down boot.
349331
cmd.arg("-nodefaults");

0 commit comments

Comments
 (0)