diff --git a/Cargo.toml b/Cargo.toml index 19d228755..6f06904e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,9 +99,6 @@ sysinfo = "0.31.4" thread-priority = "1.0.0" uptime_lib = "0.3.0" -# Kafka -rdkafka = { version = "0.36.2", default-features = false, features = ["tokio"] } - # Utility Libraries anyhow = { version = "1.0", features = ["backtrace"] } bytes = "1.4" @@ -156,3 +153,6 @@ codegen-units = 1 # adding rdkafka here because, for unsupported platforms, cargo skips other deps which come after this [target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dependencies] rdkafka = { version = "0.36.2", default-features = false, features = ["tokio"] } + +[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies] +rdkafka = { version = "0.36.2", default-features = false, features = ["tokio"] } \ No newline at end of file diff --git a/src/cli.rs b/src/cli.rs index 423339516..c1061cd65 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -26,10 +26,16 @@ use crate::{ option::{validation, Compression, Mode}, }; -#[cfg(all(target_os = "linux", target_arch = "x86_64"))] +#[cfg(any( + all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64") +))] use crate::kafka::SslProtocol as KafkaSslProtocol; -#[cfg(not(all(target_os = "linux", target_arch = "x86_64")))] +#[cfg(not(any( + all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64") +)))] use std::string::String as KafkaSslProtocol; #[derive(Debug, Default)] @@ -507,7 +513,10 @@ impl FromArgMatches for Cli { } fn update_from_arg_matches(&mut self, m: &clap::ArgMatches) -> Result<(), clap::Error> { - #[cfg(all(target_os = "linux", target_arch = "x86_64"))] + #[cfg(any( + all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64") + ))] { self.kafka_topics = m.get_one::(Self::KAFKA_TOPICS).cloned(); self.kafka_security_protocol = m diff --git a/src/lib.rs b/src/lib.rs index c2ab80bf2..973406cb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,10 @@ pub mod correlation; mod event; pub mod handlers; pub mod hottier; -#[cfg(all(target_os = "linux", target_arch = "x86_64"))] +#[cfg(any( + all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64") +))] pub mod kafka; mod livetail; mod metadata; diff --git a/src/main.rs b/src/main.rs index 798372339..80607a6d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,7 +23,10 @@ use parseable::{ }; use tracing_subscriber::EnvFilter; -#[cfg(all(target_os = "linux", target_arch = "x86_64"))] +#[cfg(any( + all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64") +))] use parseable::kafka; #[actix_web::main] @@ -49,7 +52,10 @@ async fn main() -> anyhow::Result<()> { // keep metadata info in mem metadata.set_global(); - #[cfg(all(target_os = "linux", target_arch = "x86_64"))] + #[cfg(any( + all(target_os = "linux", target_arch = "x86_64"), + all(target_os = "macos", target_arch = "aarch64") + ))] // load kafka server if CONFIG.parseable.mode != Mode::Query { tokio::task::spawn(kafka::setup_integration());