Use Rust 1.64 workspace inheritance

This commit is contained in:
Joakim Frostegård 2022-09-25 11:40:43 +02:00
parent 132b355e1b
commit 65a8c9d6ff
17 changed files with 157 additions and 122 deletions

View file

@ -16,6 +16,7 @@
* Rename request workers to swarm workers * Rename request workers to swarm workers
* Switch to thin LTO * Switch to thin LTO
* Use proper workspace path declarations and remove workspace patch section * Use proper workspace path declarations and remove workspace patch section
* Use [Rust 1.64 workspace inheritance](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html)
* Reduce space taken by ValidUntil struct from 128 to 32 bits * Reduce space taken by ValidUntil struct from 128 to 32 bits
* Use regular (non-amortized) IndexMap for peer and pending scrape response maps (but not for torrent maps) * Use regular (non-amortized) IndexMap for peer and pending scrape response maps (but not for torrent maps)
* Improve privilege dropping * Improve privilege dropping

View file

@ -1,5 +1,4 @@
[workspace] [workspace]
members = [ members = [
"aquatic", "aquatic",
"aquatic_common", "aquatic_common",
@ -18,6 +17,26 @@ members = [
"aquatic_ws_protocol", "aquatic_ws_protocol",
] ]
[workspace.package]
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/greatest-ape/aquatic"
readme = "./README.md"
rust-version = "1.64"
[workspace.dependencies]
aquatic_common = { version = "0.2.0", path = "./aquatic_common" }
aquatic_http_protocol = { version = "0.2.0", path = "./aquatic_http_protocol" }
aquatic_http = { version = "0.2.0", path = "./aquatic_http" }
aquatic_toml_config = { version = "0.2.0", path = "./aquatic_toml_config" }
aquatic_toml_config_derive = { version = "0.2.0", path = "./aquatic_toml_config_derive" }
aquatic_udp_protocol = { version = "0.2.0", path = "./aquatic_udp_protocol" }
aquatic_udp = { version = "0.2.0", path = "./aquatic_udp" }
aquatic_ws_protocol = { version = "0.2.0", path = "./aquatic_ws_protocol" }
aquatic_ws = { version = "0.2.0", path = "./aquatic_ws" }
[patch.crates-io] [patch.crates-io]
membarrier = { git = "https://github.com/glommer/membarrier-rs.git", branch = "issue-22" } membarrier = { git = "https://github.com/glommer/membarrier-rs.git", branch = "issue-22" }

View file

@ -1,20 +1,21 @@
[package] [package]
name = "aquatic" name = "aquatic"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "High-performance open BitTorrent tracker (UDP, HTTP, WebTorrent)" description = "High-performance open BitTorrent tracker (UDP, HTTP, WebTorrent)"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["bittorrent", "torrent", "webtorrent"] keywords = ["bittorrent", "torrent", "webtorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[[bin]] [[bin]]
name = "aquatic" name = "aquatic"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common" } aquatic_common.workspace = true
aquatic_http = { version = "0.2.0", path = "../aquatic_http" } aquatic_http.workspace = true
aquatic_udp = { version = "0.2.0", path = "../aquatic_udp" } aquatic_udp.workspace = true
aquatic_ws = { version = "0.2.0", path = "../aquatic_ws" } aquatic_ws.workspace = true
mimalloc = { version = "0.1", default-features = false } mimalloc = { version = "0.1", default-features = false }

View file

@ -1,12 +1,13 @@
[package] [package]
name = "aquatic_common" name = "aquatic_common"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "aquatic BitTorrent tracker common code" description = "aquatic BitTorrent tracker common code"
repository = "https://github.com/greatest-ape/aquatic" version.workspace = true
readme = "../README.md" authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_common" name = "aquatic_common"
@ -15,7 +16,7 @@ name = "aquatic_common"
rustls = ["dep:rustls", "rustls-pemfile"] rustls = ["dep:rustls", "rustls-pemfile"]
[dependencies] [dependencies]
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
ahash = "0.8" ahash = "0.8"
anyhow = "1" anyhow = "1"

View file

@ -1,13 +1,14 @@
[package] [package]
name = "aquatic_http" name = "aquatic_http"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "High-performance open BitTorrent tracker (HTTP over TLS)" description = "High-performance open BitTorrent tracker (HTTP over TLS)"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["http", "server", "peer-to-peer", "torrent", "bittorrent"] keywords = ["http", "server", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_http" name = "aquatic_http"
@ -16,9 +17,9 @@ name = "aquatic_http"
name = "aquatic_http" name = "aquatic_http"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common", features = ["rustls", "glommio"] } aquatic_common = { workspace = true, features = ["rustls", "glommio"] }
aquatic_http_protocol = { version = "0.2.0", path = "../aquatic_http_protocol" } aquatic_http_protocol.workspace = true
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
anyhow = "1" anyhow = "1"
cfg-if = "1" cfg-if = "1"

View file

@ -1,21 +1,22 @@
[package] [package]
name = "aquatic_http_load_test" name = "aquatic_http_load_test"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "BitTorrent (HTTP over TLS) load tester" description = "BitTorrent (HTTP over TLS) load tester"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["http", "benchmark", "peer-to-peer", "torrent", "bittorrent"] keywords = ["http", "benchmark", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[[bin]] [[bin]]
name = "aquatic_http_load_test" name = "aquatic_http_load_test"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common", features = ["glommio"] } aquatic_common = { workspace = true, features = ["glommio"] }
aquatic_http_protocol = { version = "0.2.0", path = "../aquatic_http_protocol" } aquatic_http_protocol.workspace = true
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
anyhow = "1" anyhow = "1"
futures-lite = "1" futures-lite = "1"

View file

@ -1,11 +1,13 @@
[package] [package]
name = "aquatic_http_private" name = "aquatic_http_private"
version = "0.2.0"
edition = "2021"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
license = "Apache-2.0"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["http", "benchmark", "peer-to-peer", "torrent", "bittorrent"] keywords = ["http", "benchmark", "peer-to-peer", "torrent", "bittorrent"]
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_http_private" name = "aquatic_http_private"
@ -14,9 +16,9 @@ name = "aquatic_http_private"
name = "aquatic_http_private" name = "aquatic_http_private"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common", features = ["rustls"] } aquatic_common = { workspace = true, features = ["rustls"] }
aquatic_http_protocol = { version = "0.2.0", path = "../aquatic_http_protocol", features = ["axum"] } aquatic_http_protocol = { workspace = true, features = ["axum"] }
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
anyhow = "1" anyhow = "1"
axum = { version = "0.5", default-features = false, features = ["headers", "http1", "matched-path", "original-uri"] } axum = { version = "0.5", default-features = false, features = ["headers", "http1", "matched-path", "original-uri"] }

View file

@ -1,13 +1,14 @@
[package] [package]
name = "aquatic_http_protocol" name = "aquatic_http_protocol"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/greatest-ape/aquatic"
description = "HTTP BitTorrent tracker protocol" description = "HTTP BitTorrent tracker protocol"
keywords = ["http", "protocol", "peer-to-peer", "torrent", "bittorrent"] keywords = ["http", "protocol", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_http_protocol" name = "aquatic_http_protocol"

View file

@ -1,20 +1,21 @@
[package] [package]
name = "aquatic_toml_config" name = "aquatic_toml_config"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "Serialize toml with comments" description = "Serialize toml with comments"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["toml"] keywords = ["toml"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_toml_config" name = "aquatic_toml_config"
[dependencies] [dependencies]
toml = "0.5" toml = "0.5"
aquatic_toml_config_derive = { version = "0.2.0", path = "../aquatic_toml_config_derive" } aquatic_toml_config_derive.workspace = true
[dev-dependencies] [dev-dependencies]
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -1,14 +1,15 @@
[package] [package]
name = "aquatic_toml_config_derive" name = "aquatic_toml_config_derive"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "Serialize toml with comments" description = "Serialize toml with comments"
repository = "https://github.com/greatest-ape/aquatic"
exclude = ["target"] exclude = ["target"]
keywords = ["toml"] keywords = ["toml"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
proc-macro = true proc-macro = true

View file

@ -1,14 +1,14 @@
[package] [package]
name = "aquatic_udp" name = "aquatic_udp"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "High-performance open UDP BitTorrent tracker" description = "High-performance open UDP BitTorrent tracker"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["udp", "server", "peer-to-peer", "torrent", "bittorrent"] keywords = ["udp", "server", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
rust-version = "1.62" authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_udp" name = "aquatic_udp"
@ -20,9 +20,9 @@ name = "aquatic_udp"
cpu-pinning = ["aquatic_common/hwloc"] cpu-pinning = ["aquatic_common/hwloc"]
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common" } aquatic_common.workspace = true
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
aquatic_udp_protocol = { version = "0.2.0", path = "../aquatic_udp_protocol" } aquatic_udp_protocol.workspace = true
anyhow = "1" anyhow = "1"
blake3 = "1" blake3 = "1"

View file

@ -1,20 +1,21 @@
[package] [package]
name = "aquatic_udp_bench" name = "aquatic_udp_bench"
version = "0.2.0" version.workspace = true
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"] authors.workspace = true
edition = "2021" edition.workspace = true
license = "Apache-2.0" license.workspace = true
repository = "https://github.com/greatest-ape/aquatic" repository.workspace = true
readme = "../README.md" readme.workspace = true
rust-version.workspace = true
[[bin]] [[bin]]
name = "aquatic_udp_bench" name = "aquatic_udp_bench"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common" } aquatic_common.workspace = true
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
aquatic_udp = { version = "0.2.0", path = "../aquatic_udp" } aquatic_udp.workspace = true
aquatic_udp_protocol = { version = "0.2.0", path = "../aquatic_udp_protocol" } aquatic_udp_protocol.workspace = true
anyhow = "1" anyhow = "1"
crossbeam-channel = "0.5" crossbeam-channel = "0.5"

View file

@ -1,13 +1,14 @@
[package] [package]
name = "aquatic_udp_load_test" name = "aquatic_udp_load_test"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "BitTorrent (UDP) load tester" description = "BitTorrent (UDP) load tester"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["udp", "benchmark", "peer-to-peer", "torrent", "bittorrent"] keywords = ["udp", "benchmark", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[features] [features]
cpu-pinning = ["aquatic_common/hwloc"] cpu-pinning = ["aquatic_common/hwloc"]
@ -16,9 +17,9 @@ cpu-pinning = ["aquatic_common/hwloc"]
name = "aquatic_udp_load_test" name = "aquatic_udp_load_test"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common" } aquatic_common.workspace = true
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
aquatic_udp_protocol = { version = "0.2.0", path = "../aquatic_udp_protocol" } aquatic_udp_protocol.workspace = true
anyhow = "1" anyhow = "1"
hashbrown = "0.12" hashbrown = "0.12"

View file

@ -1,13 +1,14 @@
[package] [package]
name = "aquatic_udp_protocol" name = "aquatic_udp_protocol"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "UDP BitTorrent tracker protocol" description = "UDP BitTorrent tracker protocol"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["udp", "protocol", "peer-to-peer", "torrent", "bittorrent"] keywords = ["udp", "protocol", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[dependencies] [dependencies]
byteorder = "1" byteorder = "1"

View file

@ -1,13 +1,14 @@
[package] [package]
name = "aquatic_ws" name = "aquatic_ws"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "High-performance open WebTorrent tracker" description = "High-performance open WebTorrent tracker"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["webtorrent", "websocket", "peer-to-peer", "torrent", "bittorrent"] keywords = ["webtorrent", "websocket", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_ws" name = "aquatic_ws"
@ -16,9 +17,9 @@ name = "aquatic_ws"
name = "aquatic_ws" name = "aquatic_ws"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common", features = ["rustls", "glommio"] } aquatic_common = { workspace = true, features = ["rustls", "glommio"] }
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
aquatic_ws_protocol = { version = "0.2.0", path = "../aquatic_ws_protocol" } aquatic_ws_protocol.workspace = true
anyhow = "1" anyhow = "1"
async-tungstenite = "0.17" async-tungstenite = "0.17"

View file

@ -1,21 +1,22 @@
[package] [package]
name = "aquatic_ws_load_test" name = "aquatic_ws_load_test"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "WebTorrent over TLS load tester" description = "WebTorrent over TLS load tester"
repository = "https://github.com/greatest-ape/aquatic"
keywords = ["webtorrent", "websocket", "benchmark", "torrent", "bittorrent"] keywords = ["webtorrent", "websocket", "benchmark", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[[bin]] [[bin]]
name = "aquatic_ws_load_test" name = "aquatic_ws_load_test"
[dependencies] [dependencies]
aquatic_common = { version = "0.2.0", path = "../aquatic_common", features = ["glommio"] } aquatic_common = { workspace = true, features = ["glommio"] }
aquatic_toml_config = { version = "0.2.0", path = "../aquatic_toml_config" } aquatic_toml_config.workspace = true
aquatic_ws_protocol = { version = "0.2.0", path = "../aquatic_ws_protocol" } aquatic_ws_protocol.workspace = true
anyhow = "1" anyhow = "1"
async-tungstenite = "0.17" async-tungstenite = "0.17"

View file

@ -1,14 +1,15 @@
[package] [package]
name = "aquatic_ws_protocol" name = "aquatic_ws_protocol"
version = "0.2.0"
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
edition = "2021"
license = "Apache-2.0"
description = "WebTorrent tracker protocol" description = "WebTorrent tracker protocol"
repository = "https://github.com/greatest-ape/aquatic"
exclude = ["target"] exclude = ["target"]
keywords = ["webtorrent", "protocol", "peer-to-peer", "torrent", "bittorrent"] keywords = ["webtorrent", "protocol", "peer-to-peer", "torrent", "bittorrent"]
readme = "../README.md" version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
rust-version.workspace = true
[lib] [lib]
name = "aquatic_ws_protocol" name = "aquatic_ws_protocol"