diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 771498de6..fff9926c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -308,6 +308,16 @@ coverage-aggregated: tags: - amd64 +check-targets: + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + stage: test + image: rust:latest + script: + - ./maint/cargo_check_target -il + after_script: + - cargo clean + pages: rules: - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == "main" diff --git a/crates/arti-client/Cargo.toml b/crates/arti-client/Cargo.toml index 291f1ffc3..ccc6e08a0 100644 --- a/crates/arti-client/Cargo.toml +++ b/crates/arti-client/Cargo.toml @@ -12,14 +12,14 @@ categories = ["network-programming", "cryptography"] repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] -default = ["tokio", "native-tls"] +default = ["tokio", "native-tls", "compression"] # "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. # * Features which may introduce unnecessary licensing restrictions. -full = ["tokio", "async-std", "native-tls", "tor-rtcompat/full", "tor-proto/full", "tor-netdoc/full", "tor-dirmgr/full"] +full = ["tokio", "async-std", "native-tls", "compression", "tor-rtcompat/full", "tor-proto/full", "tor-netdoc/full", "tor-dirmgr/full"] async-std = ["tor-rtcompat/async-std"] bridge-client = ["tor-guardmgr/bridge-client"] @@ -35,6 +35,8 @@ static-native-tls = ["tor-rtcompat/static", "native-tls"] accel-sha1-asm = ["tor-llcrypto/with-sha1-asm"] accel-openssl = ["tor-llcrypto/with-openssl"] +compression = ["tor-dirmgr/compression"] + # Enable experimental APIs that are not yet officially supported. # # These APIs are not covered by semantic versioning. Using this @@ -78,7 +80,7 @@ tor-chanmgr = { path = "../tor-chanmgr", version = "0.7.0" } tor-checkable = { path = "../tor-checkable", version = "0.3.0" } tor-circmgr = { path = "../tor-circmgr", version = "0.6.0" } tor-config = { path = "../tor-config", version = "0.6.0" } -tor-dirmgr = { path = "../tor-dirmgr", version = "0.8.0" } +tor-dirmgr = { path = "../tor-dirmgr", version = "0.8.0", default-features = false, features = ["mmap"] } tor-error = { path = "../tor-error", version = "0.3.2" } tor-guardmgr = { path = "../tor-guardmgr", version = "0.7.0" } tor-llcrypto = { path = "../tor-llcrypto", version = "0.3.5" } diff --git a/crates/arti-client/README.md b/crates/arti-client/README.md index 7c122a198..5ded18bd8 100644 --- a/crates/arti-client/README.md +++ b/crates/arti-client/README.md @@ -159,6 +159,8 @@ about these features. [native-tls](https://github.com/sfackler/rust-native-tls) crate for TLS support * `async-std` -- build with [async-std](https://async.rs/) support +* `compression` (default) -- Build support for downloading compressed + documents. Requires a C compiler. * `full` -- Build with all features above, along with all stable additive features from other arti crates. (This does not include experimental diff --git a/crates/arti/Cargo.toml b/crates/arti/Cargo.toml index c4315b842..763d24ec2 100644 --- a/crates/arti/Cargo.toml +++ b/crates/arti/Cargo.toml @@ -12,9 +12,9 @@ categories = ["command-line-utilities", "cryptography"] repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] -default = ["tokio", "native-tls", "dns-proxy", "harden"] +default = ["tokio", "native-tls", "dns-proxy", "harden", "compression"] -full = ["async-std", "tokio", "native-tls", "journald", "arti-client/full", "dns-proxy", "harden"] +full = ["async-std", "tokio", "native-tls", "journald", "arti-client/full", "dns-proxy", "harden", "compression"] async-std = [ "arti-client/async-std", @@ -40,6 +40,8 @@ journald = ["tracing-journald"] accel-sha1-asm = ["arti-client/accel-sha1-asm"] accel-openssl = ["arti-client/accel-openssl"] +compression = ["arti-client/compression"] + # This feature flag enables experimental features that are not supported. Turning it on may # void your API. experimental = ["arti-client/experimental", "experimental-api"] diff --git a/crates/arti/README.md b/crates/arti/README.md index 58d4dbbab..9c82e092d 100644 --- a/crates/arti/README.md +++ b/crates/arti/README.md @@ -121,6 +121,8 @@ work. DNS queries over the Tor network. * `harden` (default) -- Build with support for hardening the Arti process by disabling debugger attachment and other local memory-inspection vectors. +* `compression` (default) -- Build support for downloading compressed + documents. Requires a C compiler. * `full` -- Build with all features above, along with all stable additive features from other arti crates. (This does not include experimental diff --git a/crates/tor-dirmgr/Cargo.toml b/crates/tor-dirmgr/Cargo.toml index fd817427b..ad44f9237 100644 --- a/crates/tor-dirmgr/Cargo.toml +++ b/crates/tor-dirmgr/Cargo.toml @@ -12,13 +12,14 @@ categories = ["network-programming", "cryptography"] repository = "https://gitlab.torproject.org/tpo/core/arti.git/" [features] -default = ["mmap"] +default = ["mmap", "compression"] full = ["routerdesc"] experimental = ["experimental-api", "dirfilter", "bridge-client"] bridge-client = ["tor-circmgr/specific-relay", "tor-guardmgr/bridge-client", "routerdesc"] mmap = ["memmap2"] static = ["rusqlite/bundled"] +compression = ["tor-dirclient/xz", "tor-dirclient/zstd"] # (Incomplete) support for downloading and storing router descriptors routerdesc = ["tor-dirclient/routerdesc"] dirfilter = [] @@ -63,7 +64,7 @@ tor-checkable = { path = "../tor-checkable", version = "0.3.0" } tor-circmgr = { path = "../tor-circmgr", version = "0.6.0" } tor-config = { path = "../tor-config", version = "0.6.0" } tor-consdiff = { path = "../tor-consdiff", version = "0.3.0" } -tor-dirclient = { path = "../tor-dirclient", version = "0.5.0" } +tor-dirclient = { path = "../tor-dirclient", version = "0.5.0", default-features = false } tor-error = { path = "../tor-error", version = "0.3.2" } tor-guardmgr = { path = "../tor-guardmgr", version = "0.7.0" } tor-llcrypto = { path = "../tor-llcrypto", version = "0.3.5" } diff --git a/crates/tor-dirmgr/README.md b/crates/tor-dirmgr/README.md index 44788199c..c52d52896 100644 --- a/crates/tor-dirmgr/README.md +++ b/crates/tor-dirmgr/README.md @@ -26,6 +26,9 @@ reading large directory objects from disk. `routerdesc` -- (Incomplete) support for downloading and storing router descriptors. +`compression` (default) -- Build support for downloading compressed +documents. Requires a C compiler. + ### Experimental and unstable features Note that the APIs enabled by these features are NOT covered by diff --git a/doc/SupportPolicy.md b/doc/SupportPolicy.md index 163cfd099..43fecd0ee 100644 --- a/doc/SupportPolicy.md +++ b/doc/SupportPolicy.md @@ -77,7 +77,7 @@ age and the difficulty of working with them. We currently have automated tests on Linux only. On OSX and Windows, we have automated builds, but the tests are not (yet) run. In the long -run, we aim to have automated builds and testing for all of our these +run, we aim to have automated builds and testing for all of these platforms. All other modern Free operating systems are **community-supported**: diff --git a/maint/cargo_check_target b/maint/cargo_check_target new file mode 100755 index 000000000..5e75dd6fd --- /dev/null +++ b/maint/cargo_check_target @@ -0,0 +1,109 @@ +#!/bin/bash + +set -euo pipefail + +SCRIPT_NAME=$(basename "$0") + +# all targets with status "maintained" or higher" +# this should match `rustup target list | grep -E '(linux|windows|ios|darwin)' | grep -E '(arm|i.86|x86|aarch|thumb)'` +MAINTAINED_PLATFORMS=( + "aarch64-apple-darwin" + "aarch64-apple-ios" + "aarch64-apple-ios-sim" + "aarch64-linux-android" + "aarch64-pc-windows-msvc" + "aarch64-unknown-linux-gnu" + "aarch64-unknown-linux-musl" + #"arm-linux-androideabi" AtomicU64 not supported; breaks coarsetime + "arm-unknown-linux-gnueabi" + "arm-unknown-linux-gnueabihf" + "arm-unknown-linux-musleabi" + "arm-unknown-linux-musleabihf" + #"armv5te-unknown-linux-gnueabi" AtomicU64 not supported; breaks coarsetime + #"armv5te-unknown-linux-musleabi" AtomicU64 not supported; breaks coarsetime + "armv7-linux-androideabi" + "armv7-unknown-linux-gnueabi" + "armv7-unknown-linux-gnueabihf" + "armv7-unknown-linux-musleabi" + "armv7-unknown-linux-musleabihf" + #"i586-pc-windows-msvc" trait `Zeroize` is not implemented for `__m128i`; breaks aes + #"i586-unknown-linux-gnu" trait `Zeroize` is not implemented for `__m128i`; breaks aes + #"i586-unknown-linux-musl" trait `Zeroize` is not implemented for `__m128i`; breaks aes + "i686-linux-android" + "i686-pc-windows-gnu" + "i686-pc-windows-msvc" + "i686-unknown-linux-gnu" + "i686-unknown-linux-musl" + "thumbv7neon-linux-androideabi" + "thumbv7neon-unknown-linux-gnueabihf" + "x86_64-apple-darwin" + "x86_64-apple-ios" + "x86_64-linux-android" + "x86_64-pc-windows-gnu" + "x86_64-pc-windows-msvc" + "x86_64-unknown-linux-gnu" + "x86_64-unknown-linux-gnux32" + "x86_64-unknown-linux-musl" +) + +# SUPPORTTARGET, excluding emulators (x86 android...), and unusual combo (Windows on ARM...) +SUPPORTTARGETED_PLATFORMS=( + "aarch64-apple-darwin" + "aarch64-apple-ios" + "aarch64-linux-android" + "aarch64-unknown-linux-gnu" + "armv7-linux-androideabi" + "i686-pc-windows-gnu" + "i686-unknown-linux-gnu" + "x86_64-apple-darwin" + "x86_64-pc-windows-gnu" + "x86_64-pc-windows-msvc" + "x86_64-unknown-linux-gnu" + "x86_64-unknown-linux-musl" +) + +function usage() +{ + cat <: format to use when generating coverage report. one of html (default), ade, lcov, coveralls, coveralls+, files, covdir, or cobertura - -o : set the output path for the coverage report (defaiult "coverage") + -o : set the output path for the coverage report (default "coverage") Notes: You need to have grcov and llvm-tools-preview installed.