From 9793b4e7b6b1d20711fd9aa088f0969bbe730463 Mon Sep 17 00:00:00 2001 From: Yorgos Saslis Date: Fri, 19 Sep 2025 14:09:06 +0300 Subject: [PATCH] systemd: Require Linux for journal module The dependency `systemd-journal-logger` does not build on macOS, and there are no tests for other Unixes. Also, systemd is most common on Linux. To avoid compilation errors on non-Linux platforms, only depend on the crate when building on Linux. Co-authored-by: Lorenz Leutgeb --- crates/radicle-systemd/Cargo.toml | 2 ++ crates/radicle-systemd/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/radicle-systemd/Cargo.toml b/crates/radicle-systemd/Cargo.toml index cd1c9984..5d6e9064 100644 --- a/crates/radicle-systemd/Cargo.toml +++ b/crates/radicle-systemd/Cargo.toml @@ -10,6 +10,8 @@ rust-version.workspace = true [dependencies] log = { workspace = true, optional = true } + +[target.'cfg(target_os = "linux")'.dependencies] systemd-journal-logger = { version = "2.2.2", optional = true } [features] diff --git a/crates/radicle-systemd/src/lib.rs b/crates/radicle-systemd/src/lib.rs index 3e47b694..48ea1b2c 100644 --- a/crates/radicle-systemd/src/lib.rs +++ b/crates/radicle-systemd/src/lib.rs @@ -1,6 +1,6 @@ //! Library for interaction with systemd, specialized for Radicle. -#[cfg(feature = "journal")] +#[cfg(all(feature = "journal", target_os = "linux"))] pub mod journal; #[cfg(feature = "listen")]