diff --git a/attic/Cargo.toml b/attic/Cargo.toml index 1379f98..3ef5ee6 100644 --- a/attic/Cargo.toml +++ b/attic/Cargo.toml @@ -28,6 +28,7 @@ cxx = { version = "1.0", optional = true } [dependencies.tokio] version = "1.23.0" +optional = true features = [ "fs", "io-util", @@ -45,9 +46,14 @@ cxx-build = { version = "1.0", optional = true } pkg-config = "0.3.26" [features] -default = [ "nix_store" ] +default = [ "nix_store", "tokio" ] # Native libnixstore bindings. # # When disabled, the native Rust portions of nix_store can still be used. -nix_store = [ "cxx", "bindgen", "cxx-build" ] +nix_store = [ "dep:cxx", "dep:bindgen", "dep:cxx-build" ] + +# Tokio. +# +# When disabled, any part depending on tokio is unavailable. +tokio = [ "dep:tokio" ] diff --git a/attic/src/lib.rs b/attic/src/lib.rs index ec81bdf..43b0f26 100644 --- a/attic/src/lib.rs +++ b/attic/src/lib.rs @@ -22,8 +22,10 @@ pub mod hash; pub mod mime; pub mod nix_store; pub mod signing; +#[cfg(feature = "tokio")] pub mod stream; pub mod testing; +#[cfg(feature = "tokio")] pub mod util; pub use error::{AtticError, AtticResult}; diff --git a/server/Cargo.toml b/server/Cargo.toml index 4923c44..4c66df8 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -19,7 +19,7 @@ path = "src/adm/main.rs" doc = false [dependencies] -attic = { path = "../attic", default-features = false } +attic = { path = "../attic", default-features = false, features = [ "tokio" ] } attic-token = { path = "../token" } anyhow = "1.0.68"