diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml index 6fdf6bb3..cdba252d 100644 --- a/src/common/Cargo.toml +++ b/src/common/Cargo.toml @@ -13,6 +13,10 @@ license = { workspace = true } boring = { workspace = true } clocksource = { workspace = true } metriken = { workspace = true } -pelikan-net = { workspace = true, features = ["boringssl"] } +pelikan-net = { workspace = true, default-features = false } ringlog = { workspace = true } serde = { workspace = true, features = ["derive"] } + +[features] +default = ["boringssl"] +boringssl = ["pelikan-net/boringssl"] \ No newline at end of file diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs index 1bf56a94..381efb3d 100644 --- a/src/common/src/lib.rs +++ b/src/common/src/lib.rs @@ -6,5 +6,6 @@ pub mod bytes; pub mod expiry; pub mod metrics; pub mod signal; +#[cfg(feature = "boringssl")] pub mod ssl; pub mod traits; diff --git a/src/config/Cargo.toml b/src/config/Cargo.toml index 8be5dda3..f8404daf 100644 --- a/src/config/Cargo.toml +++ b/src/config/Cargo.toml @@ -10,8 +10,12 @@ repository = { workspace = true } license = { workspace = true } [dependencies] -common = { path = "../common" } +common = { path = "../common", default-features = false } log = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } toml = { workspace = true } + +[features] +default = ["boringssl"] +boringssl = ["common/boringssl"] \ No newline at end of file diff --git a/src/config/src/lib.rs b/src/config/src/lib.rs index 4b3868b1..dd49a42a 100644 --- a/src/config/src/lib.rs +++ b/src/config/src/lib.rs @@ -23,6 +23,7 @@ mod sockio; mod stats_log; mod tcp; pub mod time; +#[cfg(feature = "boringssl")] mod tls; mod units; mod worker; @@ -44,5 +45,6 @@ pub use sockio::{Sockio, SockioConfig}; pub use stats_log::StatsLogConfig; pub use tcp::{Tcp, TcpConfig}; pub use time::{Time, TimeConfig, TimeType}; +#[cfg(feature = "boringssl")] pub use tls::{Tls, TlsConfig}; pub use worker::{Worker, WorkerConfig}; diff --git a/src/config/src/pingproxy.rs b/src/config/src/pingproxy.rs index 7f35c2ad..f335ca50 100644 --- a/src/config/src/pingproxy.rs +++ b/src/config/src/pingproxy.rs @@ -50,6 +50,7 @@ pub struct PingproxyConfig { #[serde(default)] time: Time, + #[cfg(feature = "boringssl")] #[serde(default)] tls: Tls, @@ -126,6 +127,7 @@ impl TimeConfig for PingproxyConfig { } } +#[cfg(feature = "boringssl")] impl TlsConfig for PingproxyConfig { fn tls(&self) -> &Tls { &self.tls @@ -183,6 +185,7 @@ impl Default for PingproxyConfig { klog: Default::default(), sockio: Default::default(), tcp: Default::default(), + #[cfg(feature = "boringssl")] tls: Default::default(), } } diff --git a/src/config/src/pingserver.rs b/src/config/src/pingserver.rs index 01c18c2d..953ec093 100644 --- a/src/config/src/pingserver.rs +++ b/src/config/src/pingserver.rs @@ -46,6 +46,7 @@ pub struct PingserverConfig { worker: Worker, #[serde(default)] time: Time, + #[cfg(feature = "boringssl")] #[serde(default)] tls: Tls, @@ -110,6 +111,7 @@ impl TimeConfig for PingserverConfig { } } +#[cfg(feature = "boringssl")] impl TlsConfig for PingserverConfig { fn tls(&self) -> &Tls { &self.tls @@ -175,6 +177,7 @@ impl Default for PingserverConfig { klog: Default::default(), sockio: Default::default(), tcp: Default::default(), + #[cfg(feature = "boringssl")] tls: Default::default(), } } diff --git a/src/config/src/rds.rs b/src/config/src/rds.rs index 247c7751..26658538 100644 --- a/src/config/src/rds.rs +++ b/src/config/src/rds.rs @@ -46,6 +46,7 @@ pub struct RdsConfig { worker: Worker, #[serde(default)] time: Time, + #[cfg(feature = "boringssl")] #[serde(default)] tls: Tls, #[serde(default)] @@ -160,6 +161,7 @@ impl TimeConfig for RdsConfig { } } +#[cfg(feature = "boringssl")] impl TlsConfig for RdsConfig { fn tls(&self) -> &Tls { &self.tls @@ -195,6 +197,7 @@ impl Default for RdsConfig { klog: Default::default(), sockio: Default::default(), tcp: Default::default(), + #[cfg(feature = "boringssl")] tls: Default::default(), } } diff --git a/src/config/src/segcache.rs b/src/config/src/segcache.rs index e4c1d308..e12dfefe 100644 --- a/src/config/src/segcache.rs +++ b/src/config/src/segcache.rs @@ -46,6 +46,7 @@ pub struct SegcacheConfig { worker: Worker, #[serde(default)] time: Time, + #[cfg(feature = "boringssl")] #[serde(default)] tls: Tls, #[serde(default)] @@ -160,6 +161,7 @@ impl TimeConfig for SegcacheConfig { } } +#[cfg(feature = "boringssl")] impl TlsConfig for SegcacheConfig { fn tls(&self) -> &Tls { &self.tls @@ -195,6 +197,7 @@ impl Default for SegcacheConfig { klog: Default::default(), sockio: Default::default(), tcp: Default::default(), + #[cfg(feature = "boringssl")] tls: Default::default(), } } diff --git a/src/logger/Cargo.toml b/src/logger/Cargo.toml index e7b0ed21..20661503 100644 --- a/src/logger/Cargo.toml +++ b/src/logger/Cargo.toml @@ -8,6 +8,6 @@ repository = { workspace = true } license = { workspace = true } [dependencies] -common = { path = "../common" } -config = { path = "../config" } +common = { path = "../common", default-features = false } +config = { path = "../config", default-features = false } ringlog = { workspace = true } diff --git a/src/protocol/common/Cargo.toml b/src/protocol/common/Cargo.toml index 953fbc94..3d944be3 100644 --- a/src/protocol/common/Cargo.toml +++ b/src/protocol/common/Cargo.toml @@ -11,8 +11,8 @@ license = { workspace = true } [dependencies] bytes = { workspace = true } -common = { path = "../../common" } -config = { path = "../../config" } +common = { path = "../../common", default-features = false } +config = { path = "../../config", default-features = false } logger = { path = "../../logger" } storage-types = { path = "../../storage/types" } diff --git a/src/protocol/memcache/Cargo.toml b/src/protocol/memcache/Cargo.toml index c3508b71..dd70df70 100644 --- a/src/protocol/memcache/Cargo.toml +++ b/src/protocol/memcache/Cargo.toml @@ -13,7 +13,7 @@ path = "benches/request_parsing.rs" harness = false [dependencies] -common = { path = "../../common" } +common = { path = "../../common", default-features = false } clocksource = { workspace = true } logger = { path = "../../logger" } metriken = { workspace = true } diff --git a/src/protocol/ping/Cargo.toml b/src/protocol/ping/Cargo.toml index 433618f6..8b8df156 100644 --- a/src/protocol/ping/Cargo.toml +++ b/src/protocol/ping/Cargo.toml @@ -14,9 +14,9 @@ path = "benches/ping.rs" harness = false [dependencies] -common = { path = "../../common" } -config = { path = "../../config" } -logger = { path = "../../logger" } +common = { path = "../../common", default-features = false } +config = { path = "../../config", default-features = false } +logger = { path = "../../logger", default-features = false } metriken = { workspace = true } protocol-common = { path = "../../protocol/common" } storage-types = { path = "../../storage/types" }