From 36537c4c6f4529a99694dd9ca551827a08ce80c3 Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Tue, 18 Aug 2026 12:32:50 -0400 Subject: [PATCH] Make buildable/testable on macos --- agent/src/main.rs | 6 ++++++ factory/lab/src/host.rs | 2 +- factory/lab/src/pty.rs | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/agent/src/main.rs b/agent/src/main.rs index 3d677fc7..4af53010 100644 --- a/agent/src/main.rs +++ b/agent/src/main.rs @@ -57,6 +57,7 @@ mod os_constants { mod os_constants { pub const UNIT: &str = "/etc/systemd/system/buildomat-agent.service"; } +#[cfg(any(target_os = "illumos", target_os = "linux"))] use os_constants::*; use crate::control::protocol::StoreEntry; @@ -859,6 +860,11 @@ fn set_nodename(name: &str) -> Result<()> { Ok(()) } +#[cfg(not(any(target_os = "illumos", target_os = "linux")))] +fn set_nodename(_name: &str) -> Result<()> { + bail!("setting the nodename is not supported on this operating system") +} + fn zfs_exists(dataset: &str) -> Result { let out = Command::new("/sbin/zfs") .arg("get") diff --git a/factory/lab/src/host.rs b/factory/lab/src/host.rs index 347a65d3..1053805f 100644 --- a/factory/lab/src/host.rs +++ b/factory/lab/src/host.rs @@ -151,7 +151,7 @@ fn thread_serial( unsafe { cmd.pre_exec(move || { libc::setsid(); - libc::ioctl(sub, libc::TIOCSCTTY, 0); + libc::ioctl(sub, libc::TIOCSCTTY as _, 0); libc::dup2(sub, 0); libc::dup2(sub, 1); libc::dup2(sub, 2); diff --git a/factory/lab/src/pty.rs b/factory/lab/src/pty.rs index 15f7792b..525d426c 100644 --- a/factory/lab/src/pty.rs +++ b/factory/lab/src/pty.rs @@ -18,8 +18,8 @@ impl Pty { &mut m, &mut s, ptr::null_mut(), - ptr::null(), - ptr::null(), + ptr::null_mut(), + ptr::null_mut(), ) }; if r != 0 {