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 <[email protected]>
This commit is contained in:
Brandon ThomasandClaude Opus 5.5 committed 2026-10-05 10:57:30 -04:00
1 parent 20842c72e3
commit a416714ebd
1 file changed
+4 -4
+4 -4
View File
@@ -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