From 8a586a40fa4afbd5402737406b287dc488c6f66a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 10 Jun 2022 15:26:51 -0400 Subject: [PATCH] Add "full" and "experimental" features to arti-client and below. The "full" feature is a catch-all for all features, _except_: * Those that select a particular implementation (like tor-llcrypto/with-openssl) or build flag (like "static") * Those that are experimental or unstable (like "experimental-api") * Those that are testing-only. --- Cargo.lock | 2 ++ crates/arti-client/Cargo.toml | 16 +++++++++++++--- crates/tor-cell/Cargo.toml | 3 ++- crates/tor-checkable/Cargo.toml | 1 + crates/tor-circmgr/Cargo.toml | 2 ++ crates/tor-dirmgr/Cargo.toml | 3 +++ crates/tor-netdir/Cargo.toml | 2 ++ crates/tor-netdoc/Cargo.toml | 3 +++ crates/tor-proto/Cargo.toml | 2 ++ crates/tor-rtcompat/Cargo.toml | 2 ++ 10 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52ae8eda6..bad194edd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,7 +158,9 @@ dependencies = [ "tokio", "tokio-util", "tor-basic-utils", + "tor-cell", "tor-chanmgr", + "tor-checkable", "tor-circmgr", "tor-config", "tor-dirmgr", diff --git a/crates/arti-client/Cargo.toml b/crates/arti-client/Cargo.toml index 8b27acbe4..cf1456d9d 100644 --- a/crates/arti-client/Cargo.toml +++ b/crates/arti-client/Cargo.toml @@ -13,22 +13,30 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = ["tokio", "native-tls"] +# "full" is a top-level selector that turns on every feature, _EXCEPT FOR_: +# * Features that are experimental or unstable +# * Features that are testing-only +# * Features which are select a particular implementation or build flag and +# which therefore are not strictly additive. +full = ["tokio", "async-std", "native-tls", "rustls", "tor-rtcompat/full", "tor-proto/full", "tor-netdoc/full", "tor-dirmgr/full"] + async-std = ["tor-rtcompat/async-std"] tokio = ["tor-rtcompat/tokio", "tor-proto/tokio"] native-tls = ["tor-rtcompat/native-tls"] rustls = ["tor-rtcompat/rustls"] + static = ["static-sqlite", "static-native-tls"] static-sqlite = ["tor-dirmgr/static"] static-native-tls = ["tor-rtcompat/static", "native-tls"] -dirfilter = ["tor-dirmgr/dirfilter"] -error_detail = [] - # Enable experimental APIs that are not yet officially supported. # # These APIs are not covered by semantic versioning. Using this # feature voids your "semver warrantee". +experimental = ["dirfilter", "experimental-api", "error_detail", "tor-proto/experimental", "tor-cell/experimental", "tor-checkable/experimental", "tor-netdoc/experimental", "tor-dirmgr/experimental", "tor-circmgr/experimental"] experimental-api = [] +dirfilter = ["tor-dirmgr/dirfilter"] +error_detail = [] [dependencies] derive_builder = { version = "0.11.2", package = "derive_builder_fork_arti" } @@ -44,7 +52,9 @@ safelog = { path = "../safelog", version = "0.1.0" } serde = { version = "1.0.103", features = ["derive"] } thiserror = "1" tor-basic-utils = { path = "../tor-basic-utils", version = "0.3.1" } +tor-cell = { path = "../tor-cell", version = "0.3.1" } tor-chanmgr = { path = "../tor-chanmgr", version = "0.3.1" } +tor-checkable = { path = "../tor-checkable", version = "0.3.0" } tor-circmgr = { path = "../tor-circmgr", version = "0.3.1" } tor-config = { path = "../tor-config", version = "0.4.0" } tor-dirmgr = { path = "../tor-dirmgr", version = "0.4.0" } diff --git a/crates/tor-cell/Cargo.toml b/crates/tor-cell/Cargo.toml index fca8c44ef..1b8d299e0 100644 --- a/crates/tor-cell/Cargo.toml +++ b/crates/tor-cell/Cargo.toml @@ -13,10 +13,11 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = [] +experimental = ["experimental-udp"] # Enable experimental UDP support. experimental-udp = [] # Enable testing only API -testing = [ "experimental-udp" ] +testing = ["experimental-udp"] [dependencies] arrayref = "0.3" diff --git a/crates/tor-checkable/Cargo.toml b/crates/tor-checkable/Cargo.toml index b0393c44a..16daa58c6 100644 --- a/crates/tor-checkable/Cargo.toml +++ b/crates/tor-checkable/Cargo.toml @@ -12,6 +12,7 @@ categories = ["cryptography", "rust-patterns"] repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] +experimental = ["experimental-api"] experimental-api = [] [dependencies] diff --git a/crates/tor-circmgr/Cargo.toml b/crates/tor-circmgr/Cargo.toml index 246b3e438..dea0a33bd 100644 --- a/crates/tor-circmgr/Cargo.toml +++ b/crates/tor-circmgr/Cargo.toml @@ -12,10 +12,12 @@ categories = ["network-programming", "cryptography"] repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] + # Enable experimental APIs that are not yet officially supported. # # These APIs are not covered by semantic versioning. Using this # feature voids your "semver warrantee". +experimental = ["experimental-api"] experimental-api = [] [dependencies] diff --git a/crates/tor-dirmgr/Cargo.toml b/crates/tor-dirmgr/Cargo.toml index ee19da16f..88cb5a9ea 100644 --- a/crates/tor-dirmgr/Cargo.toml +++ b/crates/tor-dirmgr/Cargo.toml @@ -13,6 +13,9 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = ["mmap"] +full = ["routerdesc"] +experimental = ["experimental-api", "dirfilter"] + mmap = ["memmap2"] static = ["rusqlite/bundled"] # (Incomplete) support for downloading and storing router descriptors diff --git a/crates/tor-netdir/Cargo.toml b/crates/tor-netdir/Cargo.toml index ddd0018e9..5fdd90108 100644 --- a/crates/tor-netdir/Cargo.toml +++ b/crates/tor-netdir/Cargo.toml @@ -14,6 +14,8 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = [] +experimental = ["experimental-api"] + # Enable experimental APIs that are not yet officially supported. # # These APIs are not covered by semantic versioning. Using this diff --git a/crates/tor-netdoc/Cargo.toml b/crates/tor-netdoc/Cargo.toml index 6b3c85945..b19b3f137 100644 --- a/crates/tor-netdoc/Cargo.toml +++ b/crates/tor-netdoc/Cargo.toml @@ -14,6 +14,9 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = [] +full = ["routerdesc", "ns_consensus"] +experimental = ["build_docs", "experimental-api"] + # Enable code to build the objects that represent different network documents. build_docs = ["rand"] diff --git a/crates/tor-proto/Cargo.toml b/crates/tor-proto/Cargo.toml index 7cd50b40d..360bfa8a6 100644 --- a/crates/tor-proto/Cargo.toml +++ b/crates/tor-proto/Cargo.toml @@ -13,6 +13,8 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = [] +full = ["tokio"] +experimental = ["hs", "ntor_v3"] hs = [] ntor_v3 = [] tokio = ["tokio-crate", "tokio-util"] diff --git a/crates/tor-rtcompat/Cargo.toml b/crates/tor-rtcompat/Cargo.toml index b4c299c24..404c0862b 100644 --- a/crates/tor-rtcompat/Cargo.toml +++ b/crates/tor-rtcompat/Cargo.toml @@ -14,6 +14,8 @@ repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] default = [] +full = ["async-std", "tokio", "native-tls", "rustls"] + async-std = ["async-std-crate", "async-io", "async_executors/async_std"] tokio = ["tokio-crate", "tokio-util", "async_executors/tokio_tp"] # TODO: This feature makes us link native-tls statically even if we