From a416714ebdd18cd5156ce4e24808c9c1e87006d7 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 5 Oct 2026 07:34:05 -0400 Subject: [PATCH] FreeBSD: CI builds and tests PrintCraft in a FreeBSD VM A new FreeBSD workflow builds the workspace and runs its tests in a FreeBSD 14.3 VM (vmactions/freebsd-vm, pinned by commit) with rustup stable, on PRs, pushes to main, nightly and on demand. The fuzzer's address-space cap now applies on FreeBSD too (its sh has ulimit -v). PrintCraft's platform code was already Unix-general: everything that isn't macOS-specific takes the same path on Linux and FreeBSD. Co-Authored-By: Claude Opus 5.5 --- xtask/src/fuzz.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xtask/src/fuzz.rs b/xtask/src/fuzz.rs index 9b42c2b4..c8a32829 100644 --- a/xtask/src/fuzz.rs +++ b/xtask/src/fuzz.rs @@ -225,15 +225,15 @@ enum Outcome { Hang, } -/// Address-space cap for each child on Linux, in KiB (4 GiB). An input that makes us allocate +/// Address-space cap for each child on Linux and FreeBSD, in KiB (4 GiB). An input that makes us allocate /// without bound then fails its allocation in the child (an abort, kept as a crash finding) /// instead of exhausting the machine: on CI that killed the runner and lost the findings. const CHILD_ADDRESS_SPACE_KIB: u64 = 4 * 1024 * 1024; -/// The child process, under the address-space cap where the shell can set one (Linux; macOS -/// does not support `ulimit -v` and Windows has no `sh`). +/// The child process, under the address-space cap where the shell can set one (Linux and +/// FreeBSD; macOS does not support `ulimit -v` and Windows has no `sh`). fn child_command(exe: &Path) -> Command { - if cfg!(target_os = "linux") { + if cfg!(any(target_os = "linux", target_os = "freebsd")) { let mut c = Command::new("sh"); c.args(["-c", &format!("ulimit -v {CHILD_ADDRESS_SPACE_KIB} && exec \"$0\" \"$@\"")]).arg(exe); c