From 84fca315bc5c288af597cbf7d354072f90c1d3f4 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Fri, 14 Aug 2026 20:20:06 +0300 Subject: [PATCH] default NetBSD builds without guest version --- .github/workflows/e2e-bsd.yml | 3 +-- kbuildx/src/commands/bsd.rs | 19 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e-bsd.yml b/.github/workflows/e2e-bsd.yml index 6d32f62..42c33e4 100644 --- a/.github/workflows/e2e-bsd.yml +++ b/.github/workflows/e2e-bsd.yml @@ -26,8 +26,7 @@ jobs: artifact: freebsd/freebsd-15.1.x86_64.kernel - name: NetBSD 10.1 os: netbsd - version: "10.1" - artifact: netbsd/netbsd-10.1.x86_64.kernel + artifact: netbsd/netbsd-current.x86_64.kernel steps: - name: Check out repository diff --git a/kbuildx/src/commands/bsd.rs b/kbuildx/src/commands/bsd.rs index 99fe394..cc88e76 100644 --- a/kbuildx/src/commands/bsd.rs +++ b/kbuildx/src/commands/bsd.rs @@ -95,10 +95,7 @@ pub fn build_bsd(args: BuildArgs) -> Result<()> { { bail!("Linux config, module, initrd, and uImage options cannot be used with BSD builds"); } - let version = args - .kernel_version - .as_deref() - .ok_or_else(|| anyhow::anyhow!("a FreeBSD or NetBSD version is required"))?; + let version = args.kernel_version.as_deref().unwrap_or("current"); let os = args.os; let os_name = match os { BuildOs::Freebsd => "freebsd", @@ -170,14 +167,12 @@ fn start_bsd_sandbox(os: BuildOs, version: &str, cpus: u32, memory: u32) -> Resu // Use the stable NetBSD 10.1 guest image, matching the package // repository used by the bsdkrun workflows. The requested version // still selects the source ref and artifact label below. - let guest_version = machine_version; - let output = Command::new(bsdkrun_binary()) + let mut command = Command::new(bsdkrun_binary()); + command .arg(os_name) .arg("-d") .arg("--name") .arg(&name) - .arg("--version") - .arg(guest_version) .arg("--cpus") .arg(cpus.to_string()) .arg("--mem") @@ -187,9 +182,11 @@ fn start_bsd_sandbox(os: BuildOs, version: &str, cpus: u32, memory: u32) -> Resu .arg("--volume") .arg(&name) .stdout(Stdio::piped()) - .stderr(Stdio::inherit()) - .output() - .context("creating BSD build sandbox")?; + .stderr(Stdio::inherit()); + if !(os == BuildOs::Netbsd && version == "current") { + command.arg("--version").arg(machine_version); + } + let output = command.output().context("creating BSD build sandbox")?; if !output.status.success() { bail!("unable to create {os_name} build sandbox"); } -- 2.51.2