From 287936035e2062af1165848bab297f14c5179e5a Mon Sep 17 00:00:00 2001 From: Kevin Phoenix Date: Fri, 8 Dec 2023 15:53:23 -0700 Subject: [PATCH] Nop out daemonization on windows --- .github/workflows/ci.yml | 1 + crates/bh_agent_server/Cargo.toml | 2 ++ crates/bh_agent_server/src/main.rs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6c7542..69f342e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: - x86_64-unknown-linux-musl # Windows targets + - aarch64-pc-windows-gnu - i686-pc-windows-gnu - x86_64-pc-windows-gnu steps: diff --git a/crates/bh_agent_server/Cargo.toml b/crates/bh_agent_server/Cargo.toml index 0b4ecfa..4fe1199 100644 --- a/crates/bh_agent_server/Cargo.toml +++ b/crates/bh_agent_server/Cargo.toml @@ -17,4 +17,6 @@ log = "0.4.20" env_logger = { version = "0.10.0", default-features = false, features = ["auto-color", "humantime"] } bimap = "0.6.3" clap = { version = "4.4.11", features = ["derive"] } + +[target.'cfg(not(target_os = "windows"))'.dependencies] daemonize = "0.5.0" diff --git a/crates/bh_agent_server/src/main.rs b/crates/bh_agent_server/src/main.rs index 6b72fed..c3afa66 100644 --- a/crates/bh_agent_server/src/main.rs +++ b/crates/bh_agent_server/src/main.rs @@ -18,6 +18,7 @@ struct Args { address: IpAddr, /// The port to listen on port: u16, + #[cfg(not(target_os = "windows"))] #[arg(short, long, default_value = "false", help = "Daemonize the process")] daemonize: bool, } @@ -39,6 +40,7 @@ fn main() -> anyhow::Result<()> { listener.config_mut().max_frame_length(usize::MAX); // Daemonize + #[cfg(not(target_os = "windows"))] if args.daemonize { daemonize::Daemonize::new() .pid_file("/tmp/bh_agent_server.pid")