feature flag async-std

This commit is contained in:
John Smith 2022-06-26 21:12:16 -04:00
parent 2799e0464a
commit ebea72c9db
3 changed files with 23 additions and 14 deletions

View File

@ -10,9 +10,11 @@ license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)"
crate-type = ["cdylib", "staticlib", "rlib"] crate-type = ["cdylib", "staticlib", "rlib"]
[features] [features]
default = [ "rt-async-std" ]
android_tests = [] android_tests = []
ios_tests = [ "simplelog", "backtrace" ] ios_tests = [ "simplelog", "backtrace" ]
tracking = [ "backtrace" ] tracking = [ "backtrace" ]
rt-async-std = [ "async-std", "async-tungstenite/async-std-runtime", "async-std-resolver", "async_executors/async_std", "rtnetlink?/smol_socket" ]
[dependencies] [dependencies]
tracing = { version = "^0", features = ["log", "attributes"] } tracing = { version = "^0", features = ["log", "attributes"] }
@ -42,7 +44,6 @@ enumset = { version= "^1", features = ["serde"] }
backtrace = { version = "^0", optional = true } backtrace = { version = "^0", optional = true }
owo-colors = "^3" owo-colors = "^3"
stop-token = "^0" stop-token = "^0"
ed25519-dalek = { version = "^1", default_features = false, features = ["alloc", "u64_backend"] } ed25519-dalek = { version = "^1", default_features = false, features = ["alloc", "u64_backend"] }
x25519-dalek = { package = "x25519-dalek-ng", version = "^1", default_features = false, features = ["u64_backend"] } x25519-dalek = { package = "x25519-dalek-ng", version = "^1", default_features = false, features = ["u64_backend"] }
curve25519-dalek = { package = "curve25519-dalek-ng", version = "^4", default_features = false, features = ["alloc", "u64_backend"] } curve25519-dalek = { package = "curve25519-dalek-ng", version = "^4", default_features = false, features = ["alloc", "u64_backend"] }
@ -51,14 +52,16 @@ rand = "0.7"
# curve25519-dalek-ng is stuck on digest 0.9.0 # curve25519-dalek-ng is stuck on digest 0.9.0
blake3 = { version = "1.1.0", default_features = false } blake3 = { version = "1.1.0", default_features = false }
digest = "0.9.0" digest = "0.9.0"
rtnetlink = { version = "^0", default-features = false, optional = true }
# Dependencies for native builds only # Dependencies for native builds only
# Linux, Windows, Mac, iOS, Android # Linux, Windows, Mac, iOS, Android
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
async-std = { version = "^1", features = ["unstable"] } async-std = { version = "^1", features = ["unstable"], optional = true}
async-io = { version = "^1" } async-io = { version = "^1" }
async-tungstenite = { version = "^0", features = ["async-std-runtime", "async-tls"] } async-tungstenite = { version = "^0", features = ["async-tls"] }
async-std-resolver = { version = "^0" } async-std-resolver = { version = "^0", optional = true }
maplit = "^1" maplit = "^1"
config = { version = "^0", features = ["yaml"] } config = { version = "^0", features = ["yaml"] }
keyring-manager = { path = "../external/keyring-manager" } keyring-manager = { path = "../external/keyring-manager" }
@ -74,7 +77,7 @@ data-encoding = { version = "^2" }
serde = { version = "^1", features = ["derive" ] } serde = { version = "^1", features = ["derive" ] }
serde_cbor = { version = "^0" } serde_cbor = { version = "^0" }
serde_json = { version = "^1" } serde_json = { version = "^1" }
async_executors = { version = "^0", default-features = false, features = [ "async_std" ]} async_executors = { version = "^0", default-features = false }
socket2 = "^0" socket2 = "^0"
bugsalot = "^0" bugsalot = "^0"
chrono = "^0" chrono = "^0"
@ -133,7 +136,7 @@ ifstructs = "^0"
# Dependencies for Linux or Android # Dependencies for Linux or Android
[target.'cfg(any(target_os = "android",target_os = "linux"))'.dependencies] [target.'cfg(any(target_os = "android",target_os = "linux"))'.dependencies]
rtnetlink = { version = "^0", default-features = false, features = [ "smol_socket" ] } rtnetlink = { version = "^0", default-features = false }
# Dependencies for Windows # Dependencies for Windows
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]

View File

@ -1,5 +1,9 @@
#![deny(clippy::all)] #![deny(clippy::all)]
#![deny(unused_must_use)] #![deny(unused_must_use)]
#[cfg(all(feature = "rt-async-std", feature = "rt-tokio"))]
compile_error!(
"feature \"rt-async-std\" and feature \"rt-tokio\" cannot be enabled at the same time"
);
#[macro_use] #[macro_use]
extern crate alloc; extern crate alloc;

View File

@ -10,18 +10,23 @@ license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)"
name = "veilid-server" name = "veilid-server"
path = "src/main.rs" path = "src/main.rs"
[features]
default = [ "rt-async-std" ]
rt-async-std = [ "veilid-core/rt-async-std", "async-std", "async-tungstenite/async-std-runtime", "opentelemetry/rt-async-std", "opentelemetry-otlp/grpc-sys"]
tracking = ["veilid-core/tracking"]
[dependencies] [dependencies]
veilid-core = { path = "../veilid-core" }
tracing = { version = "^0", features = ["log", "attributes"] } tracing = { version = "^0", features = ["log", "attributes"] }
tracing-subscriber = { version = "^0", features = ["env-filter"] } tracing-subscriber = { version = "^0", features = ["env-filter"] }
tracing-appender = "^0" tracing-appender = "^0"
tracing-opentelemetry = "^0" tracing-opentelemetry = "^0"
opentelemetry = { version = "^0", features = ["rt-async-std"] } opentelemetry = { version = "^0" }
opentelemetry-otlp = { version = "^0", features = ["grpc-sys"] } opentelemetry-otlp = { version = "^0" }
opentelemetry-semantic-conventions = "^0" opentelemetry-semantic-conventions = "^0"
clap = "^3" clap = "^3"
async-std = { version = "^1", features = ["unstable"] } async-std = { version = "^1", features = ["unstable"], optional = true }
async-tungstenite = { version = "^0", features = ["async-std-runtime", "async-tls"] } async-tungstenite = { version = "^0", features = ["async-tls"] }
veilid-core = { path = "../veilid-core" }
directories = "^4" directories = "^4"
capnp = "^0" capnp = "^0"
parking_lot = "^0" parking_lot = "^0"
@ -59,6 +64,3 @@ serial_test = "^0"
[build-dependencies] [build-dependencies]
capnpc = "^0" capnpc = "^0"
[features]
tracking = ["veilid-core/tracking"]