forked from continuwuation/continuwuity
This commit adds the config option `enable_msc4495_selective_presence`, which will allow server operators to toggle MSC4495 before it is merged into the spec. As this proposal is likely to break people's workflow up until clients adequately support it, this gate is enabled for now. We also pave the framework for future optional MSCs, by allowing the `unstable_features()` function to take in a `Config` instance. This is also propagated to callsites where it is used for path building by Ruma.
986 lines
24 KiB
TOML
986 lines
24 KiB
TOML
[workspace]
|
|
resolver = "2"
|
|
members = ["src/*", "xtask/"]
|
|
default-members = ["src/*"]
|
|
|
|
[workspace.package]
|
|
authors = ["Continuwuity Team and contributors <team@continuwuity.org>"]
|
|
description = "A Matrix homeserver written in Rust, the official continuation of the conduwuit homeserver."
|
|
edition = "2024"
|
|
homepage = "https://continuwuity.org/"
|
|
license = "Apache-2.0"
|
|
# See also `rust-toolchain.toml`
|
|
readme = "README.md"
|
|
repository = "https://forgejo.ellis.link/continuwuation/continuwuity"
|
|
version = "26.7.1"
|
|
|
|
[workspace.metadata.crane]
|
|
name = "conduwuit"
|
|
|
|
[workspace.dependencies.arrayvec]
|
|
version = "0.7.6"
|
|
features = ["serde"]
|
|
|
|
[workspace.dependencies.smallvec]
|
|
version = "1.14.0"
|
|
features = [
|
|
"const_generics",
|
|
"const_new",
|
|
"serde",
|
|
"union",
|
|
"write",
|
|
]
|
|
|
|
[workspace.dependencies.smallstr]
|
|
version = "0.3"
|
|
features = ["ffi", "std", "union"]
|
|
|
|
[workspace.dependencies.const-str]
|
|
version = "1.1.0"
|
|
|
|
[workspace.dependencies.ctor]
|
|
version = "1.0.6"
|
|
|
|
[workspace.dependencies.dtor]
|
|
version = "1.0.0"
|
|
|
|
[workspace.dependencies.cargo_toml]
|
|
version = "1.0"
|
|
default-features = false
|
|
features = ["features"]
|
|
|
|
[workspace.dependencies.toml]
|
|
version = "1.1.2"
|
|
default-features = false
|
|
features = ["parse", "serde"]
|
|
|
|
[workspace.dependencies.sanitize-filename]
|
|
version = "0.6.0"
|
|
|
|
[workspace.dependencies.base64]
|
|
version = "0.22.1"
|
|
default-features = false
|
|
|
|
# used for TURN server authentication
|
|
[workspace.dependencies.hmac]
|
|
version = "0.13.0"
|
|
default-features = false
|
|
|
|
# used for checking if an IP is in specific subnets / CIDR ranges easier
|
|
[workspace.dependencies.ipaddress]
|
|
version = "0.1.3"
|
|
|
|
[workspace.dependencies.rand]
|
|
version = "0.10.1"
|
|
|
|
# Used for the http request / response body type for Ruma endpoints used with reqwest
|
|
[workspace.dependencies.bytes]
|
|
version = "1.10.1"
|
|
|
|
[workspace.dependencies.http-body-util]
|
|
version = "0.1.3"
|
|
|
|
[workspace.dependencies.http]
|
|
version = "1.3.1"
|
|
|
|
[workspace.dependencies.regex]
|
|
version = "1.11.1"
|
|
|
|
[workspace.dependencies.axum]
|
|
version = "0.8.8"
|
|
default-features = false
|
|
features = [
|
|
"form",
|
|
"http1",
|
|
"http2",
|
|
"json",
|
|
"matched-path",
|
|
"tokio",
|
|
"tracing",
|
|
]
|
|
|
|
[workspace.dependencies.axum-extra]
|
|
version = "0.12.0"
|
|
default-features = false
|
|
features = ["typed-header", "tracing", "cookie"]
|
|
|
|
[workspace.dependencies.axum-server]
|
|
version = "0.8.0"
|
|
default-features = false
|
|
|
|
# to listen on both HTTP and HTTPS if listening on TLS dierctly from conduwuit for complement or sytest
|
|
[workspace.dependencies.axum-server-dual-protocol]
|
|
# version = "0.7"
|
|
git = "https://github.com/vinchona/axum-server-dual-protocol.git"
|
|
rev = "ca6db055254255b74238673ce4135698e347d71c" # feat!: bump axum_server to 0.8.0
|
|
default-features = false
|
|
|
|
[workspace.dependencies.client-ip]
|
|
version = "0.2"
|
|
|
|
[workspace.dependencies.tower]
|
|
version = "0.5.2"
|
|
default-features = false
|
|
features = ["util"]
|
|
|
|
[workspace.dependencies.tower-http]
|
|
version = "0.7.0"
|
|
default-features = false
|
|
features = [
|
|
"add-extension",
|
|
"catch-panic",
|
|
"cors",
|
|
"sensitive-headers",
|
|
"set-header",
|
|
"timeout",
|
|
"trace",
|
|
"util",
|
|
]
|
|
|
|
[workspace.dependencies.rustls]
|
|
version = "0.23.25"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.reqwest]
|
|
version = "0.13.2"
|
|
default-features = false
|
|
features = [
|
|
"rustls-no-provider",
|
|
"socks",
|
|
"hickory-dns",
|
|
"http2",
|
|
"stream",
|
|
]
|
|
|
|
[workspace.dependencies.serde]
|
|
version = "1.0.219"
|
|
default-features = false
|
|
features = ["rc"]
|
|
|
|
[workspace.dependencies.serde_json]
|
|
version = "1.0.140"
|
|
default-features = false
|
|
features = ["raw_value"]
|
|
|
|
# Used for appservice registration files
|
|
[workspace.dependencies.serde-saphyr]
|
|
version = "0.0.29"
|
|
|
|
# Used to load forbidden room/user regex from config
|
|
[workspace.dependencies.serde_regex]
|
|
version = "1.1.0"
|
|
|
|
# Used for ruma wrapper
|
|
[workspace.dependencies.serde_html_form]
|
|
version = "0.4.0"
|
|
|
|
# Used for password hashing
|
|
[workspace.dependencies.argon2]
|
|
version = "0.5.3"
|
|
features = ["alloc", "rand"]
|
|
default-features = false
|
|
|
|
# Used to generate thumbnails for images
|
|
[workspace.dependencies.image]
|
|
version = "0.25.5"
|
|
default-features = false
|
|
features = [
|
|
"jpeg",
|
|
"png",
|
|
"gif",
|
|
"webp",
|
|
]
|
|
|
|
# logging
|
|
[workspace.dependencies.log]
|
|
version = "0.4.27"
|
|
default-features = false
|
|
[workspace.dependencies.tracing]
|
|
version = "0.1.41"
|
|
default-features = false
|
|
[workspace.dependencies.tracing-subscriber]
|
|
version = "0.3.20"
|
|
default-features = false
|
|
features = ["env-filter", "std", "tracing", "tracing-log", "ansi", "fmt"]
|
|
[workspace.dependencies.tracing-journald]
|
|
version = "0.3.1"
|
|
[workspace.dependencies.tracing-core]
|
|
version = "0.1.34"
|
|
default-features = false
|
|
|
|
# for URL previews
|
|
[workspace.dependencies.webpage]
|
|
version = "2.0.1"
|
|
default-features = false
|
|
|
|
# used for conduwuit's CLI and admin room command parsing
|
|
[workspace.dependencies.clap]
|
|
version = "4.5.35"
|
|
default-features = false
|
|
features = [
|
|
"derive",
|
|
"env",
|
|
"error-context",
|
|
"help",
|
|
"std",
|
|
"string",
|
|
"usage",
|
|
]
|
|
|
|
[workspace.dependencies.futures]
|
|
version = "0.3.31"
|
|
default-features = false
|
|
features = ["std", "async-await"]
|
|
|
|
[workspace.dependencies.tokio]
|
|
version = "1.44.2"
|
|
default-features = false
|
|
features = [
|
|
"fs",
|
|
"net",
|
|
"macros",
|
|
"sync",
|
|
"signal",
|
|
"time",
|
|
"rt-multi-thread",
|
|
"io-util",
|
|
"tracing",
|
|
]
|
|
|
|
[workspace.dependencies.tokio-metrics]
|
|
version = "0.5.0"
|
|
|
|
[workspace.dependencies.libloading]
|
|
version = "0.9.0"
|
|
|
|
# Validating urls in config, was already a transitive dependency
|
|
[workspace.dependencies.url]
|
|
version = "2.5.4"
|
|
default-features = false
|
|
features = ["serde"]
|
|
|
|
# standard date and time tools
|
|
[workspace.dependencies.chrono]
|
|
version = "0.4.38"
|
|
features = ["alloc", "std"]
|
|
default-features = false
|
|
|
|
[workspace.dependencies.hyper]
|
|
version = "1.6.0"
|
|
default-features = false
|
|
features = [
|
|
"server",
|
|
"http1",
|
|
"http2",
|
|
]
|
|
|
|
[workspace.dependencies.hyper-util]
|
|
version = "=0.1.20"
|
|
default-features = false
|
|
features = [
|
|
"server-auto",
|
|
"server-graceful",
|
|
"tokio",
|
|
]
|
|
|
|
# to support multiple variations of setting a config option
|
|
[workspace.dependencies.either]
|
|
version = "1.15.0"
|
|
default-features = false
|
|
features = ["serde"]
|
|
|
|
# Used for reading the configuration from continuwuity.toml & environment variables
|
|
[workspace.dependencies.figment]
|
|
version = "0.10.19"
|
|
default-features = false
|
|
features = ["env", "toml"]
|
|
|
|
[workspace.dependencies.hickory-resolver]
|
|
version = "0.26.0"
|
|
default-features = false
|
|
features = [
|
|
"serde",
|
|
"system-config",
|
|
"tokio",
|
|
]
|
|
|
|
# Used for conduwuit::Error type
|
|
[workspace.dependencies.thiserror]
|
|
version = "2.0.12"
|
|
default-features = false
|
|
|
|
# Used when hashing the state
|
|
[workspace.dependencies.ring]
|
|
version = "0.17.14"
|
|
default-features = false
|
|
|
|
# Used to make working with iterators easier, was already a transitive depdendency
|
|
[workspace.dependencies.itertools]
|
|
version = "0.15.0"
|
|
|
|
# to parse user-friendly time durations in admin commands
|
|
#TODO: overlaps chrono?
|
|
[workspace.dependencies.cyborgtime]
|
|
version = "2.1.1"
|
|
|
|
# used for MPSC channels
|
|
[workspace.dependencies.loole]
|
|
version = "0.4.0"
|
|
|
|
# used for MPMC channels
|
|
[workspace.dependencies.async-channel]
|
|
version = "2.5.0"
|
|
|
|
[workspace.dependencies.async-trait]
|
|
version = "0.1.88"
|
|
|
|
[workspace.dependencies.lru-cache]
|
|
version = "0.1.2"
|
|
|
|
[workspace.dependencies.assign]
|
|
version = "1.1.1"
|
|
|
|
# Used for matrix spec type definitions and helpers
|
|
[workspace.dependencies.ruma]
|
|
git = "https://github.com/ruma/ruma.git"
|
|
rev = "e7284c31da289f0a3b885191f5b2b6b307fa059f"
|
|
features = [
|
|
"appservice-api-c",
|
|
"client-api",
|
|
"federation-api",
|
|
"push-gateway-api-c",
|
|
"state-res",
|
|
"rand",
|
|
"markdown",
|
|
"ring-compat",
|
|
"compat-upload-signatures",
|
|
"compat-optional-txn-pdus",
|
|
"compat-get-3pids",
|
|
"unstable-msc2867",
|
|
"unstable-msc2870",
|
|
"unstable-msc3061",
|
|
"unstable-msc3814",
|
|
"unstable-msc3245",
|
|
"unstable-msc3381",
|
|
"unstable-msc3489",
|
|
"unstable-msc3930",
|
|
"unstable-msc4075",
|
|
"unstable-msc4095",
|
|
"unstable-msc4121",
|
|
"unstable-msc4125",
|
|
"unstable-msc4186",
|
|
"unstable-msc4195",
|
|
"unstable-msc4203",
|
|
"unstable-msc4310",
|
|
"unstable-msc4380",
|
|
"unstable-msc4143",
|
|
"unstable-msc4293",
|
|
"unstable-msc4406",
|
|
"unstable-msc4439",
|
|
"unstable-msc4466",
|
|
"unstable-msc4495",
|
|
"unstable-extensible-events",
|
|
]
|
|
|
|
[workspace.dependencies.rust-rocksdb]
|
|
git = "https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1"
|
|
rev = "0a25ff92f7c09b55eec496b9c192c7d5136ab2b8"
|
|
default-features = false
|
|
features = [
|
|
"multi-threaded-cf",
|
|
"mt_static",
|
|
"lz4",
|
|
"zstd",
|
|
"bzip2",
|
|
]
|
|
|
|
[workspace.dependencies.sha2]
|
|
version = "0.11.0"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.sha1]
|
|
version = "0.11.0"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.openidconnect]
|
|
version = "4.0.1"
|
|
|
|
# optional opentelemetry, performance measurements, flamegraphs, etc for performance measurements and monitoring
|
|
[workspace.dependencies.opentelemetry]
|
|
version = "0.32.0"
|
|
|
|
[workspace.dependencies.tracing-flame]
|
|
version = "0.2.0"
|
|
|
|
[workspace.dependencies.tracing-opentelemetry]
|
|
version = "0.33.0"
|
|
|
|
[workspace.dependencies.opentelemetry_sdk]
|
|
version = "0.32.0"
|
|
features = ["rt-tokio"]
|
|
|
|
[workspace.dependencies.opentelemetry-otlp]
|
|
version = "0.32.0"
|
|
features = ["http", "grpc-tonic", "trace", "logs", "metrics"]
|
|
|
|
|
|
|
|
# optional sentry metrics for crash/panic reporting
|
|
[workspace.dependencies.sentry]
|
|
version = "0.48.0"
|
|
default-features = false
|
|
features = [
|
|
"backtrace",
|
|
"contexts",
|
|
"debug-images",
|
|
"panic",
|
|
"tower",
|
|
"tower-http",
|
|
"tracing",
|
|
"reqwest",
|
|
"log",
|
|
]
|
|
|
|
[workspace.dependencies.sentry-tracing]
|
|
version = "0.48.0"
|
|
[workspace.dependencies.sentry-tower]
|
|
version = "0.48.0"
|
|
|
|
# jemalloc usage
|
|
[workspace.dependencies.tikv-jemalloc-sys]
|
|
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
|
rev = "df86ff89d4b1e223b9f7d2dd2fbb7f202da7f554"
|
|
default-features = false
|
|
features = [
|
|
"background_threads_runtime_support",
|
|
"unprefixed_malloc_on_supported_platforms",
|
|
]
|
|
[workspace.dependencies.tikv-jemallocator]
|
|
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
|
rev = "df86ff89d4b1e223b9f7d2dd2fbb7f202da7f554"
|
|
default-features = false
|
|
features = [
|
|
"background_threads_runtime_support",
|
|
"unprefixed_malloc_on_supported_platforms",
|
|
]
|
|
[workspace.dependencies.tikv-jemalloc-ctl]
|
|
git = "https://forgejo.ellis.link/continuwuation/jemallocator"
|
|
rev = "df86ff89d4b1e223b9f7d2dd2fbb7f202da7f554"
|
|
default-features = false
|
|
features = ["use_std"]
|
|
|
|
[workspace.dependencies.console-subscriber]
|
|
version = "0.5"
|
|
|
|
[workspace.dependencies.nix]
|
|
version = "0.31.0"
|
|
default-features = false
|
|
features = ["resource"]
|
|
|
|
[workspace.dependencies.sd-notify]
|
|
version = "0.5.0"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.hardened_malloc-rs]
|
|
version = "0.1.2"
|
|
default-features = false
|
|
features = [
|
|
"static",
|
|
"gcc",
|
|
"light",
|
|
]
|
|
|
|
[workspace.dependencies.rustyline-async]
|
|
version = "0.4.9"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.termimad]
|
|
version = "0.35.0"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.checked_ops]
|
|
version = "0.1"
|
|
|
|
[workspace.dependencies.syn]
|
|
version = "3.0"
|
|
default-features = false
|
|
features = ["full", "extra-traits"]
|
|
|
|
[workspace.dependencies.quote]
|
|
version = "1.0"
|
|
|
|
[workspace.dependencies.proc-macro2]
|
|
version = "1.0"
|
|
|
|
[workspace.dependencies.parking_lot]
|
|
version = "0.12.4"
|
|
features = ["hardware-lock-elision", "deadlock_detection"] # TODO: Check if deadlock_detection has a perf impact, if it does only enable with debug_assertions
|
|
|
|
# Use this when extending with_lock::WithLock to parking_lot
|
|
[workspace.dependencies.lock_api]
|
|
version = "0.4.13"
|
|
|
|
[workspace.dependencies.bytesize]
|
|
version = "2.0"
|
|
|
|
[workspace.dependencies.core_affinity]
|
|
version = "0.8.3"
|
|
|
|
[workspace.dependencies.libc]
|
|
version = "0.2"
|
|
|
|
[workspace.dependencies.num-traits]
|
|
version = "0.2"
|
|
|
|
[workspace.dependencies.minicbor]
|
|
version = "2.1.1"
|
|
features = ["std"]
|
|
|
|
[workspace.dependencies.minicbor-serde]
|
|
version = "0.7.0"
|
|
features = ["std"]
|
|
|
|
[workspace.dependencies.maplit]
|
|
version = "1.0.2"
|
|
|
|
[workspace.dependencies.yansi]
|
|
version = "1.0.1"
|
|
|
|
[workspace.dependencies.askama]
|
|
version = "0.16.0"
|
|
|
|
[workspace.dependencies.lettre]
|
|
version = "0.11.19"
|
|
default-features = false
|
|
features = ["smtp-transport", "pool", "hostname", "builder", "rustls", "rustls-native-certs", "tokio1", "rustls-no-provider", "tokio1-rustls", "tracing", "serde"]
|
|
|
|
[workspace.dependencies.governor]
|
|
version = "0.10.4"
|
|
default-features = false
|
|
features = ["std"]
|
|
|
|
[workspace.dependencies.nonzero_ext]
|
|
version = "0.3.0"
|
|
|
|
[workspace.dependencies.resolvematrix]
|
|
version = "1.2.0"
|
|
|
|
[workspace.dependencies.serde_urlencoded]
|
|
version = "0.7.1"
|
|
|
|
#
|
|
# Patches
|
|
#
|
|
|
|
# backport of [https://github.com/tokio-rs/tracing/pull/2956] to the 0.1.x branch of tracing.
|
|
# we can switch back to upstream if #2956 is merged and backported in the upstream repo.
|
|
|
|
|
|
# adds a tab completion callback: https://forgejo.ellis.link/continuwuation/rustyline-async/src/branch/main/.patchy/0002-add-tab-completion-callback.patch
|
|
# adds event for CTRL+\: https://forgejo.ellis.link/continuwuation/rustyline-async/src/branch/main/.patchy/0001-add-event-for-ctrl.patch
|
|
[patch.crates-io.rustyline-async]
|
|
git = "https://forgejo.ellis.link/continuwuation/rustyline-async"
|
|
rev = "b13aca2cc08d5f78303746cd192d9a03d73e768e"
|
|
|
|
# adds LIFO queue scheduling; this should be updated with PR progress.
|
|
[patch.crates-io.event-listener]
|
|
git = "https://forgejo.ellis.link/continuwuation/event-listener"
|
|
rev = "b2c19bcaf5a0a69c38c034e417bda04a9b991529"
|
|
[patch.crates-io.async-channel]
|
|
git = "https://forgejo.ellis.link/continuwuation/async-channel"
|
|
rev = "e990f0006b68dc9bace7a3c95fc90b5c4e44948d"
|
|
|
|
# adds affinity masks for selecting more than one core at a time
|
|
[patch.crates-io.core_affinity]
|
|
git = "https://forgejo.ellis.link/continuwuation/core_affinity_rs"
|
|
rev = "7c7a9dea35382743a63837cdd1d977efdb8f1b8a"
|
|
|
|
# reverts hyperium#148 conflicting with our delicate federation resolver hooks
|
|
[patch.crates-io.hyper-util]
|
|
git = "https://forgejo.ellis.link/continuwuation/hyper-util"
|
|
rev = "09fcd3bf4656c81a8ad573bee410ab2b57f60b86"
|
|
|
|
#
|
|
# Our crates
|
|
#
|
|
|
|
[workspace.dependencies.conduwuit-router]
|
|
package = "conduwuit_router"
|
|
path = "src/router"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-admin]
|
|
package = "conduwuit_admin"
|
|
path = "src/admin"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-api]
|
|
package = "conduwuit_api"
|
|
path = "src/api"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-service]
|
|
package = "conduwuit_service"
|
|
path = "src/service"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-database]
|
|
package = "conduwuit_database"
|
|
path = "src/database"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-core]
|
|
package = "conduwuit_core"
|
|
path = "src/core"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-macros]
|
|
package = "conduwuit_macros"
|
|
path = "src/macros"
|
|
default-features = false
|
|
|
|
[workspace.dependencies.conduwuit-web]
|
|
package = "conduwuit_web"
|
|
path = "src/web"
|
|
default-features = false
|
|
|
|
|
|
[workspace.dependencies.conduwuit-build-metadata]
|
|
package = "conduwuit_build_metadata"
|
|
path = "src/build_metadata"
|
|
default-features = false
|
|
|
|
|
|
[workspace.dependencies.conduwuit]
|
|
package = "conduwuit"
|
|
path = "src/main"
|
|
|
|
[workspace.dependencies.ruminuwuity]
|
|
package = "ruminuwuity"
|
|
path = "src/ruminuwuity"
|
|
|
|
###############################################################################
|
|
#
|
|
# Release profiles
|
|
#
|
|
|
|
[profile.release]
|
|
strip = "symbols"
|
|
lto = "thin"
|
|
|
|
# release profile with debug symbols
|
|
[profile.release-debuginfo]
|
|
inherits = "release"
|
|
debug = "full"
|
|
strip = "none"
|
|
|
|
[profile.release-high-perf]
|
|
inherits = "release"
|
|
lto = "fat"
|
|
codegen-units = 1
|
|
panic = "abort"
|
|
|
|
# do not use without profile-rustflags enabled
|
|
[profile.release-max-perf]
|
|
inherits = "release"
|
|
strip = "symbols"
|
|
lto = "fat"
|
|
|
|
[profile.release-max-perf.build-override]
|
|
inherits = "release-max-perf"
|
|
opt-level = 0
|
|
codegen-units = 32
|
|
#rustflags = [
|
|
# '-Crelocation-model=pic',
|
|
# '-Ctarget-feature=-crt-static',
|
|
# '-Clink-arg=-Wl,--no-gc-sections',
|
|
#]
|
|
|
|
[profile.release-max-perf.package.conduwuit_macros]
|
|
inherits = "release-max-perf.build-override"
|
|
#rustflags = [
|
|
# '-Crelocation-model=pic',
|
|
# '-Ctarget-feature=-crt-static',
|
|
#]
|
|
|
|
[profile.bench]
|
|
inherits = "release"
|
|
#rustflags = [
|
|
# "-Cremark=all",
|
|
# '-Ztime-passes',
|
|
# '-Ztime-llvm-passes',
|
|
#]
|
|
|
|
###############################################################################
|
|
#
|
|
# Developer profile
|
|
#
|
|
|
|
# To enable hot-reloading:
|
|
# 1. Uncomment all of the rustflags here.
|
|
# 2. Uncomment crate-type=dylib in src/*/Cargo.toml
|
|
#
|
|
# opt-level, mir-opt-level, validate-mir are not known to interfere with reloading
|
|
# and can be raised if build times are tolerable.
|
|
|
|
[profile.dev]
|
|
debug = "full"
|
|
opt-level = 0
|
|
panic = "unwind"
|
|
debug-assertions = true
|
|
incremental = true
|
|
#rustflags = [
|
|
# '--cfg', 'conduwuit_mods',
|
|
# '-Ztime-passes',
|
|
# '-Zmir-opt-level=0',
|
|
# '-Zvalidate-mir=false',
|
|
# '-Ztls-model=global-dynamic',
|
|
# '-Cprefer-dynamic=true',
|
|
# '-Zstaticlib-prefer-dynamic=true',
|
|
# '-Zstaticlib-allow-rdylib-deps=true',
|
|
# '-Zpacked-bundled-libs=false',
|
|
# '-Zplt=true',
|
|
# '-Crpath=true',
|
|
# '-Clink-arg=-Wl,--as-needed',
|
|
# '-Clink-arg=-Wl,--allow-shlib-undefined',
|
|
# '-Clink-arg=-Wl,-z,keep-text-section-prefix',
|
|
# '-Clink-arg=-Wl,-z,lazy',
|
|
#]
|
|
|
|
[profile.dev.package.conduwuit_core]
|
|
inherits = "dev"
|
|
[profile.dev.package.conduwuit]
|
|
inherits = "dev"
|
|
#rustflags = [
|
|
# '--cfg', 'conduwuit_mods',
|
|
# '-Ztime-passes',
|
|
# '-Zmir-opt-level=0',
|
|
# '-Zvalidate-mir=false',
|
|
# '-Ztls-model=global-dynamic',
|
|
# '-Cprefer-dynamic=true',
|
|
# '-Zexport-executable-symbols=true',
|
|
# '-Zplt=true',
|
|
# '-Crpath=true',
|
|
# '-Clink-arg=-Wl,--as-needed',
|
|
# '-Clink-arg=-Wl,--allow-shlib-undefined',
|
|
# '-Clink-arg=-Wl,--export-dynamic',
|
|
# '-Clink-arg=-Wl,-z,lazy',
|
|
#]
|
|
|
|
[profile.dev.package.'*']
|
|
inherits = "dev"
|
|
debug = 'limited'
|
|
codegen-units = 1
|
|
opt-level = 'z'
|
|
#rustflags = [
|
|
# '--cfg', 'conduwuit_mods',
|
|
# '-Ztls-model=global-dynamic',
|
|
# '-Cprefer-dynamic=true',
|
|
# '-Zstaticlib-prefer-dynamic=true',
|
|
# '-Zstaticlib-allow-rdylib-deps=true',
|
|
# '-Zpacked-bundled-libs=true',
|
|
# '-Zplt=true',
|
|
# '-Clink-arg=-Wl,--as-needed',
|
|
# '-Clink-arg=-Wl,-z,lazy',
|
|
# '-Clink-arg=-Wl,-z,nodelete',
|
|
#]
|
|
|
|
# primarily used for CI
|
|
[profile.test]
|
|
inherits = "dev"
|
|
strip = false
|
|
opt-level = 0
|
|
codegen-units = 16
|
|
|
|
[profile.test.package.'*']
|
|
inherits = "dev"
|
|
debug = 0
|
|
strip = false
|
|
opt-level = 0
|
|
codegen-units = 16
|
|
|
|
###############################################################################
|
|
#
|
|
# Linting
|
|
#
|
|
|
|
[workspace.lints.rust]
|
|
absolute-paths-not-starting-with-crate = "warn"
|
|
#box-pointers = "warn"
|
|
deprecated-in-future = "warn"
|
|
elided-lifetimes-in-paths = "warn"
|
|
explicit-outlives-requirements = "warn"
|
|
ffi-unwind-calls = "warn"
|
|
keyword-idents = "warn"
|
|
macro-use-extern-crate = "warn"
|
|
meta-variable-misuse = "warn"
|
|
missing-abi = "warn"
|
|
#missing-copy-implementations = "warn" # TODO
|
|
#missing-debug-implementations = "warn" # TODO
|
|
non-ascii-idents = "warn"
|
|
rust-2021-incompatible-closure-captures = "warn"
|
|
rust-2021-incompatible-or-patterns = "warn"
|
|
rust-2021-prefixes-incompatible-syntax = "warn"
|
|
rust-2021-prelude-collisions = "warn"
|
|
single-use-lifetimes = "warn"
|
|
trivial-casts = "warn"
|
|
trivial-numeric-casts = "warn"
|
|
unit-bindings = "warn"
|
|
#unnameable-types = "warn" # TODO
|
|
unreachable-pub = "warn"
|
|
unsafe-op-in-unsafe-fn = "warn"
|
|
unstable-features = "warn"
|
|
unused-extern-crates = "warn"
|
|
unused-import-braces = "warn"
|
|
unused-lifetimes = "warn"
|
|
unused-macro-rules = "warn"
|
|
unused-qualifications = "warn"
|
|
#unused-results = "warn" # TODO
|
|
|
|
## some sadness
|
|
mismatched_lifetime_syntaxes = "allow" # TODO!
|
|
let_underscore_drop = "allow"
|
|
missing_docs = "allow"
|
|
# cfgs cannot be limited to expected cfgs or their de facto non-transitive/opt-in use-case e.g.
|
|
# tokio_unstable will warn.
|
|
unexpected_cfgs = "allow"
|
|
# this seems to suggest broken code and is not working correctly
|
|
unused_braces = "allow"
|
|
# buggy, but worth checking on occasionally
|
|
unused_crate_dependencies = "allow"
|
|
unsafe_code = "allow"
|
|
variant_size_differences = "allow"
|
|
|
|
# we check nightly clippy lints
|
|
unknown_lints = "allow"
|
|
|
|
#######################################
|
|
#
|
|
# Clippy lints
|
|
#
|
|
|
|
[workspace.lints.clippy]
|
|
|
|
###################
|
|
cargo = { level = "warn", priority = -1 }
|
|
# Nobody except for us should be consuming these crates, they don't need metadata
|
|
cargo_common_metadata = { level = "allow" }
|
|
|
|
## some sadness
|
|
multiple_crate_versions = { level = "allow", priority = 1 }
|
|
|
|
###################
|
|
complexity = { level = "warn", priority = -1 }
|
|
|
|
###################
|
|
correctness = { level = "warn", priority = -1 }
|
|
|
|
###################
|
|
nursery = { level = "warn", priority = -1 }
|
|
|
|
## some sadness
|
|
missing_const_for_fn = { level = "allow", priority = 1 } # TODO
|
|
option_if_let_else = { level = "allow", priority = 1 } # TODO
|
|
redundant_pub_crate = { level = "allow", priority = 1 } # TODO
|
|
significant_drop_in_scrutinee = { level = "allow", priority = 1 } # TODO
|
|
significant_drop_tightening = { level = "allow", priority = 1 } # TODO
|
|
|
|
###################
|
|
pedantic = { level = "warn", priority = -1 }
|
|
|
|
## some sadness
|
|
too_long_first_doc_paragraph = { level = "allow", priority = 1 }
|
|
doc_markdown = { level = "allow", priority = 1 }
|
|
enum_glob_use = { level = "allow", priority = 1 }
|
|
if_not_else = { level = "allow", priority = 1 }
|
|
if_then_some_else_none = { level = "allow", priority = 1 }
|
|
inline_always = { level = "allow", priority = 1 }
|
|
match_bool = { level = "allow", priority = 1 }
|
|
missing_docs_in_private_items = { level = "allow", priority = 1 }
|
|
missing_errors_doc = { level = "allow", priority = 1 }
|
|
missing_panics_doc = { level = "allow", priority = 1 }
|
|
module_name_repetitions = { level = "allow", priority = 1 }
|
|
needless_continue = { level = "allow", priority = 1 }
|
|
no_effect_underscore_binding = { level = "allow", priority = 1 }
|
|
similar_names = { level = "allow", priority = 1 }
|
|
single_match_else = { level = "allow", priority = 1 }
|
|
struct_excessive_bools = { level = "allow", priority = 1 }
|
|
struct_field_names = { level = "allow", priority = 1 }
|
|
unnecessary_wraps = { level = "allow", priority = 1 }
|
|
unused_async = { level = "allow", priority = 1 }
|
|
|
|
###################
|
|
perf = { level = "warn", priority = -1 }
|
|
|
|
###################
|
|
#restriction = "warn"
|
|
|
|
#allow_attributes = "warn" # UNSTABLE
|
|
arithmetic_side_effects = "warn"
|
|
as_conversions = "warn"
|
|
as_underscore = "warn"
|
|
assertions_on_result_states = "warn"
|
|
dbg_macro = "warn"
|
|
default_union_representation = "warn"
|
|
deref_by_slicing = "warn"
|
|
empty_drop = "warn"
|
|
empty_structs_with_brackets = "warn"
|
|
exit = "warn"
|
|
filetype_is_file = "warn"
|
|
float_cmp_const = "warn"
|
|
fn_to_numeric_cast_any = "warn"
|
|
format_push_string = "warn"
|
|
get_unwrap = "warn"
|
|
impl_trait_in_params = "warn"
|
|
lossy_float_literal = "warn"
|
|
mem_forget = "warn"
|
|
missing_assert_message = "warn"
|
|
mutex_atomic = "warn"
|
|
pub_without_shorthand = "warn"
|
|
rc_buffer = "warn"
|
|
rc_mutex = "warn"
|
|
redundant_type_annotations = "warn"
|
|
rest_pat_in_fully_bound_structs = "warn"
|
|
semicolon_outside_block = "warn"
|
|
str_to_string = "warn"
|
|
string_lit_chars_any = "warn"
|
|
string_slice = "warn"
|
|
|
|
suspicious_xor_used_as_pow = "warn"
|
|
tests_outside_test_module = "warn"
|
|
try_err = "warn"
|
|
undocumented_unsafe_blocks = "warn"
|
|
unnecessary_safety_comment = "warn"
|
|
unnecessary_safety_doc = "warn"
|
|
unnecessary_self_imports = "warn"
|
|
unneeded_field_pattern = "warn"
|
|
unseparated_literal_suffix = "warn"
|
|
#unwrap_used = "warn" # TODO
|
|
verbose_file_reads = "warn"
|
|
|
|
###################
|
|
style = { level = "warn", priority = -1 }
|
|
|
|
## some sadness
|
|
# trivial assertions are quite alright
|
|
assertions_on_constants = { level = "allow", priority = 1 }
|
|
module_inception = { level = "allow", priority = 1 }
|
|
obfuscated_if_else = { level = "allow", priority = 1 }
|
|
|
|
###################
|
|
suspicious = { level = "warn", priority = -1 }
|
|
|
|
## some sadness
|
|
let_underscore_future = { level = "allow", priority = 1 }
|
|
|
|
# rust doesnt understand conduwuit's custom log macros
|
|
literal_string_with_formatting_args = { level = "allow", priority = 1 }
|
|
|
|
|
|
needless_raw_string_hashes = "allow"
|
|
|
|
# TODO: Enable this lint & fix all instances
|
|
collapsible_if = "allow"
|
|
|
|
# TODO: break these apart
|
|
cognitive_complexity = "allow"
|