Skip to content

Commit 7c2bb3e

Browse files
authored
fixes for kafka on macOS (#1090)
1 parent cc259d5 commit 7c2bb3e

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ sysinfo = "0.31.4"
9999
thread-priority = "1.0.0"
100100
uptime_lib = "0.3.0"
101101

102-
# Kafka
103-
rdkafka = { version = "0.36.2", default-features = false, features = ["tokio"] }
104-
105102
# Utility Libraries
106103
anyhow = { version = "1.0", features = ["backtrace"] }
107104
bytes = "1.4"
@@ -156,3 +153,6 @@ codegen-units = 1
156153
# adding rdkafka here because, for unsupported platforms, cargo skips other deps which come after this
157154
[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dependencies]
158155
rdkafka = { version = "0.36.2", default-features = false, features = ["tokio"] }
156+
157+
[target.'cfg(all(target_os = "macos", target_arch = "aarch64"))'.dependencies]
158+
rdkafka = { version = "0.36.2", default-features = false, features = ["tokio"] }

src/cli.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ use crate::{
2626
option::{validation, Compression, Mode},
2727
};
2828

29-
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
29+
#[cfg(any(
30+
all(target_os = "linux", target_arch = "x86_64"),
31+
all(target_os = "macos", target_arch = "aarch64")
32+
))]
3033
use crate::kafka::SslProtocol as KafkaSslProtocol;
3134

32-
#[cfg(not(all(target_os = "linux", target_arch = "x86_64")))]
35+
#[cfg(not(any(
36+
all(target_os = "linux", target_arch = "x86_64"),
37+
all(target_os = "macos", target_arch = "aarch64")
38+
)))]
3339
use std::string::String as KafkaSslProtocol;
3440

3541
#[derive(Debug, Default)]
@@ -507,7 +513,10 @@ impl FromArgMatches for Cli {
507513
}
508514

509515
fn update_from_arg_matches(&mut self, m: &clap::ArgMatches) -> Result<(), clap::Error> {
510-
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
516+
#[cfg(any(
517+
all(target_os = "linux", target_arch = "x86_64"),
518+
all(target_os = "macos", target_arch = "aarch64")
519+
))]
511520
{
512521
self.kafka_topics = m.get_one::<String>(Self::KAFKA_TOPICS).cloned();
513522
self.kafka_security_protocol = m

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ pub mod correlation;
2727
mod event;
2828
pub mod handlers;
2929
pub mod hottier;
30-
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
30+
#[cfg(any(
31+
all(target_os = "linux", target_arch = "x86_64"),
32+
all(target_os = "macos", target_arch = "aarch64")
33+
))]
3134
pub mod kafka;
3235
mod livetail;
3336
mod metadata;

src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ use parseable::{
2323
};
2424
use tracing_subscriber::EnvFilter;
2525

26-
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
26+
#[cfg(any(
27+
all(target_os = "linux", target_arch = "x86_64"),
28+
all(target_os = "macos", target_arch = "aarch64")
29+
))]
2730
use parseable::kafka;
2831

2932
#[actix_web::main]
@@ -49,7 +52,10 @@ async fn main() -> anyhow::Result<()> {
4952
// keep metadata info in mem
5053
metadata.set_global();
5154

52-
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
55+
#[cfg(any(
56+
all(target_os = "linux", target_arch = "x86_64"),
57+
all(target_os = "macos", target_arch = "aarch64")
58+
))]
5359
// load kafka server
5460
if CONFIG.parseable.mode != Mode::Query {
5561
tokio::task::spawn(kafka::setup_integration());

0 commit comments

Comments
 (0)