Unclear how to enable async-std backend
I'm trying to build and run arti with the async-std backend, due to tokio currently being incompatible with Shadow (https://github.com/shadow/shadow/issues/1648)
I was able to achieve this before with
cargo build --no-default-features --features async-std
Currently though, I still get the tokio
backend. e.g. if I patch locally:
diff --git a/crates/arti/src/lib.rs b/crates/arti/src/lib.rs
index f163ba8d..f9113c5e 100644
--- a/crates/arti/src/lib.rs
+++ b/crates/arti/src/lib.rs
@@ -337,7 +337,8 @@ pub fn main_main() -> Result<()> {
cfg_if::cfg_if! {
if #[cfg(all(feature="tokio", feature="native-tls"))] {
- use tor_rtcompat::tokio::TokioNativeTlsRuntime as ChosenRuntime;
+ use tor_rtcompat::tokio::TokioNativeTlsRuntime as ChosenRuntime;
+ panic!("wut");
} else if #[cfg(all(feature="tokio", feature="rustls"))] {
use tor_rtcompat::tokio::TokioRustlsRuntime as ChosenRuntime;
} else if #[cfg(all(feature="async-std", feature="native-tls"))] {
I get some build-time warnings due to everything after the panic
being unreachable, and the panic
execute at runtime.
I'm still poking around the Cargo documentation to try to debug what's happening. It seems like either the --no-default-feature
flag isn't being respected at all, or the tokio
feature is getting transitively added back in by one of the other crates, in which case it takes precedence even if the async-std
feature is also enabled