From dd949ab51cc93c4d46e29890b24bb884af7db500 Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Sun, 12 May 2024 19:34:10 +0200 Subject: [PATCH] Lower dependency count (#533) * remove some dependencies * replace criterion with divan * get rid of a rustls version * remove buildscript * replace anyhow dep * Use patched versions of OpenTelemetry crates * mount allocprofiler in benches * use bench groups and args * remove own util stuff --- Cargo.lock | 980 +++++------------- Cargo.toml | 13 +- crates/kitsune-cache/Cargo.toml | 2 +- crates/kitsune-cache/src/in_memory.rs | 10 +- crates/kitsune-derive/impl/Cargo.toml | 2 +- crates/kitsune-observability/Cargo.toml | 2 +- crates/kitsune-observability/src/lib.rs | 5 +- crates/kitsune-oidc/Cargo.toml | 2 +- .../kitsune-oidc/src/state/store/in_memory.rs | 5 +- crates/kitsune-scss-compiler/Cargo.toml | 4 +- crates/kitsune-scss-compiler/src/lib.rs | 11 +- kitsune-cli/Cargo.toml | 2 +- kitsune-cli/build.rs | 9 - kitsune-cli/src/main.rs | 3 +- kitsune/Cargo.toml | 5 +- kitsune/src/http/graphql/mutation/mod.rs | 5 +- lib/athena/src/common.rs | 4 +- lib/athena/src/redis/mod.rs | 29 +- lib/athena/src/redis/util.rs | 27 - lib/cursiv/Cargo.toml | 2 +- lib/geomjeungja/Cargo.toml | 2 +- lib/http-compat/Cargo.toml | 13 - lib/http-compat/LICENSE-APACHE-2.0 | 1 - lib/http-compat/LICENSE-MIT | 1 - lib/http-compat/src/lib.rs | 8 - lib/http-compat/src/v0_2.rs | 74 -- lib/http-compat/src/v1.rs | 64 -- lib/http-signatures/Cargo.toml | 2 +- .../benches/build_cavage_signature_string.rs | 28 +- .../benches/parse_cavage_header.rs | 26 +- lib/masto-id-convert/Cargo.toml | 2 +- lib/masto-id-convert/benches/process.rs | 25 +- lib/post-process/Cargo.toml | 4 +- lib/post-process/benches/simple.rs | 26 +- lib/post-process/tests/transformation.rs | 9 +- lib/tick-tock-mock/Cargo.toml | 2 +- lib/tick-tock-mock/benches/simple_now.rs | 68 +- lib/trials/macros/Cargo.toml | 2 +- 38 files changed, 443 insertions(+), 1036 deletions(-) delete mode 100644 kitsune-cli/build.rs delete mode 100644 lib/athena/src/redis/util.rs delete mode 100644 lib/http-compat/Cargo.toml delete mode 120000 lib/http-compat/LICENSE-APACHE-2.0 delete mode 120000 lib/http-compat/LICENSE-MIT delete mode 100644 lib/http-compat/src/lib.rs delete mode 100644 lib/http-compat/src/v0_2.rs delete mode 100644 lib/http-compat/src/v1.rs diff --git a/Cargo.lock b/Cargo.lock index 380f4b0fa..2c532c3a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "d1eb7c4fcde1858a6796c18a729b661346d38e05a207e2d9028bce822fc20283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -122,12 +122,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - [[package]] name = "anstream" version = "0.6.14" @@ -214,7 +208,7 @@ dependencies = [ "argh_shared", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -270,8 +264,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41603f7cdbf5ac4af60760f17253eb6adf6ec5b6f14a7ed830cf687d375f163" dependencies = [ "askama", - "axum-core 0.4.3", - "http 1.1.0", + "axum-core", + "http", ] [[package]] @@ -287,7 +281,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -305,19 +299,6 @@ dependencies = [ "nom", ] -[[package]] -name = "async-channel" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" -dependencies = [ - "concurrent-queue", - "event-listener 5.3.0", - "event-listener-strategy 0.5.2", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-compression" version = "0.4.10" @@ -344,11 +325,10 @@ dependencies = [ "async-stream", "async-trait", "base64 0.22.1", - "blocking", "bytes", "fnv", "futures-util", - "http 1.1.0", + "http", "indexmap 2.2.6", "mime", "multer", @@ -376,7 +356,7 @@ checksum = "d94b2673899046dbbb803dff9c400330f7908727f5edb99979c3d841136ee754" dependencies = [ "async-graphql", "async-trait", - "axum 0.7.5", + "axum", "bytes", "futures-util", "serde_json", @@ -399,7 +379,7 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.61", + "syn 2.0.63", "thiserror", ] @@ -427,17 +407,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -457,15 +426,9 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.80" @@ -474,7 +437,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -519,46 +482,12 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core 0.3.4", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "itoa 1.0.11", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 0.1.2", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" version = "0.7.5" @@ -566,15 +495,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", - "axum-core 0.4.3", + "axum-core", "axum-macros", "base64 0.21.7", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-util", "itoa 1.0.11", "matchit", @@ -598,23 +527,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.4.3" @@ -624,8 +536,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -642,14 +554,14 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733" dependencies = [ - "axum 0.7.5", - "axum-core 0.4.3", + "axum", + "axum-core", "bytes", "cookie", "futures-util", "headers", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", @@ -668,11 +580,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1353f895919cf98d30146a7bb8e2275a5f096d1f6252be9101dbd29e8fe22e2f" dependencies = [ "async-trait", - "axum-core 0.4.3", + "axum-core", "axum-extra", "base64 0.21.7", "cookie", - "http 1.1.0", + "http", "serde", "serde_json", "tower-layer", @@ -688,7 +600,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -777,16 +689,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "bcder" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627747a6774aab38beb35990d88309481378558875a41da1a4b2e373c906ef0" -dependencies = [ - "bytes", - "smallvec", -] - [[package]] name = "beef" version = "0.5.2" @@ -892,20 +794,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "blocking" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" -dependencies = [ - "async-channel", - "async-lock", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - [[package]] name = "blowocking" version = "0.0.1-pre.6" @@ -1094,12 +982,6 @@ dependencies = [ "winx", ] -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "castaway" version = "0.2.2" @@ -1146,33 +1028,6 @@ dependencies = [ "stacker", ] -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "clap" version = "4.5.4" @@ -1205,7 +1060,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1224,6 +1079,12 @@ dependencies = [ "serde", ] +[[package]] +name = "codemap" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e769b5c8c8283982a987c6e948e540254f1058d5a74b8794914d4ef5fc2a24" + [[package]] name = "color-eyre" version = "0.6.3" @@ -1286,13 +1147,10 @@ dependencies = [ ] [[package]] -name = "concurrent-queue" -version = "2.5.0" +name = "condtype" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] +checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af" [[package]] name = "console" @@ -1518,43 +1376,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "futures", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - [[package]] name = "crossbeam-channel" version = "0.5.12" @@ -1589,12 +1410,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1654,7 +1469,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1663,12 +1478,12 @@ version = "0.0.1-pre.6" dependencies = [ "aliri_braid", "async-trait", - "axum-core 0.4.3", + "axum-core", "blake3", "cookie", "futures-test", "hex-simd", - "http 1.1.0", + "http", "pin-project-lite", "rand 0.8.5", "tower", @@ -1701,7 +1516,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1725,7 +1540,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1736,7 +1551,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1752,10 +1567,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", + "der_derive", + "flagset", "pem-rfc7468", "zeroize", ] +[[package]] +name = "der_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fe87ce4529967e0ba1dcf8450bab64d97dfd5010a6256187ffe2e43e6f0e049" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.63", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1784,7 +1612,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1794,7 +1622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1827,7 +1655,7 @@ checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1867,7 +1695,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1896,7 +1724,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -1917,6 +1745,31 @@ dependencies = [ "subtle", ] +[[package]] +name = "divan" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d567df2c9c2870a43f3f2bd65aaeb18dbce1c18f217c3e564b4fbaeb3ee56c" +dependencies = [ + "cfg-if", + "clap", + "condtype", + "divan-macros", + "libc", + "regex-lite", +] + +[[package]] +name = "divan-macros" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27540baf49be0d484d8f0130d7d8da3011c32a44d4fc873368154f1510e574a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.63", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -2070,7 +1923,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -2082,7 +1935,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -2119,48 +1972,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.0", - "pin-project-lite", -] - [[package]] name = "example-mrf" version = "0.0.1-pre.6" @@ -2240,6 +2051,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +[[package]] +name = "flagset" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb3aa5e95cf9aabc17f060cfa0ced7b83f042390760ca53bf09df9968acaa1" + [[package]] name = "flate2" version = "1.0.30" @@ -2365,16 +2182,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.30" @@ -2383,7 +2190,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -2466,7 +2273,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -2563,6 +2370,20 @@ dependencies = [ "regex-syntax 0.8.3", ] +[[package]] +name = "grass_compiler" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cf7d155dd7cef20195016d01005033a5521aad307033f0f8e8bf0a02f5f7554" +dependencies = [ + "codemap", + "indexmap 2.2.6", + "lasso", + "once_cell", + "phf 0.11.2", + "rand 0.8.5", +] + [[package]] name = "group" version = "0.13.0" @@ -2574,25 +2395,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.4" @@ -2604,7 +2406,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 1.1.0", + "http", "indexmap 2.2.6", "slab", "tokio", @@ -2612,16 +2414,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - [[package]] name = "halfbrown" version = "0.2.5" @@ -2669,7 +2461,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http 1.1.0", + "http", "httpdate", "mime", "sha1", @@ -2681,7 +2473,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 1.1.0", + "http", ] [[package]] @@ -2738,12 +2530,9 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", "thiserror", "tinyvec", "tokio", - "tokio-rustls 0.24.1", "tracing", "url", ] @@ -2763,11 +2552,9 @@ dependencies = [ "parking_lot 0.12.2", "rand 0.8.5", "resolv-conf", - "rustls 0.21.12", "smallvec", "thiserror", "tokio", - "tokio-rustls 0.24.1", "tracing", ] @@ -2822,18 +2609,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.61", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa 1.0.11", + "syn 2.0.63", ] [[package]] @@ -2847,17 +2623,6 @@ dependencies = [ "itoa 1.0.11", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -2865,7 +2630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -2876,19 +2641,11 @@ checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", "futures-core", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "pin-project-lite", ] -[[package]] -name = "http-compat" -version = "0.0.1-pre.6" -dependencies = [ - "http 0.2.12", - "http 1.1.0", -] - [[package]] name = "http-range-header" version = "0.4.1" @@ -2903,9 +2660,9 @@ dependencies = [ "base64-simd", "blowocking", "const-oid", - "criterion", "derive_builder", - "http 1.1.0", + "divan", + "http", "httpdate", "itertools 0.12.1", "logos 0.14.0", @@ -2949,30 +2706,6 @@ dependencies = [ "libm", ] -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa 1.0.11", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.3.1" @@ -2982,9 +2715,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.4", - "http 1.1.0", - "http-body 1.0.0", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa 1.0.11", @@ -3001,8 +2734,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "908bb38696d7a037a01ebcc68a00634112ac2bbf8ca74e30a2c3d2f4f021302b" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.3.1", + "http", + "hyper", "hyper-util", "log", "rustls 0.23.5", @@ -3015,14 +2748,15 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper 0.14.28", + "hyper", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", ] [[package]] @@ -3034,9 +2768,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -3223,17 +2957,6 @@ dependencies = [ "serde", ] -[[package]] -name = "is-terminal" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "is_ci" version = "1.2.0" @@ -3349,7 +3072,7 @@ dependencies = [ "async-graphql-axum", "async-trait", "athena", - "axum 0.7.5", + "axum", "axum-extra", "axum-flash", "blowocking", @@ -3364,7 +3087,7 @@ dependencies = [ "fs_extra", "futures-util", "headers", - "http 1.1.0", + "http", "http-body-util", "http-signatures", "iso8601-timestamp", @@ -3443,9 +3166,9 @@ dependencies = [ "diesel-async", "futures-util", "headers", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.3.1", + "hyper", "iso8601-timestamp", "kitsune-cache", "kitsune-config", @@ -3501,7 +3224,7 @@ name = "kitsune-captcha" version = "0.0.1-pre.6" dependencies = [ "enum_dispatch", - "http 1.1.0", + "http", "kitsune-error", "kitsune-http-client", "serde", @@ -3522,6 +3245,7 @@ dependencies = [ "dotenvy", "envy", "kitsune-config", + "kitsune-core", "kitsune-db", "kitsune-error", "serde", @@ -3607,7 +3331,7 @@ version = "0.0.1-pre.6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -3636,7 +3360,7 @@ dependencies = [ "diesel", "diesel-async", "embed-sdk", - "http 1.1.0", + "http", "iso8601-timestamp", "kitsune-db", "kitsune-derive", @@ -3651,10 +3375,10 @@ dependencies = [ name = "kitsune-error" version = "0.0.1-pre.6" dependencies = [ - "axum-core 0.4.3", + "axum-core", "eyre", "garde", - "http 1.1.0", + "http", "simd-json", "sync_wrapper 1.0.1", "tracing", @@ -3699,10 +3423,10 @@ dependencies = [ "async-stream", "bytes", "futures-util", - "http-body 1.0.0", + "http-body", "http-body-util", "http-signatures", - "hyper 1.3.1", + "hyper", "hyper-rustls", "hyper-util", "kitsune-type", @@ -3808,8 +3532,7 @@ dependencies = [ "async-trait", "eyre", "http-body-util", - "http-compat", - "hyper 1.3.1", + "hyper", "kitsune-config", "kitsune-http-client", "opentelemetry", @@ -3827,7 +3550,7 @@ name = "kitsune-oidc" version = "0.0.1-pre.6" dependencies = [ "enum_dispatch", - "http 1.1.0", + "http", "http-body-util", "kitsune-config", "kitsune-derive", @@ -3851,7 +3574,7 @@ version = "0.0.1-pre.6" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http", "kitsune-error", "kitsune-http-client", "kitsune-test", @@ -3866,9 +3589,9 @@ dependencies = [ name = "kitsune-scss-compiler" version = "0.0.1-pre.6" dependencies = [ - "anyhow", + "eyre", "glob", - "rsass", + "grass_compiler", "tracing", ] @@ -3884,7 +3607,7 @@ dependencies = [ "enum_dispatch", "futures-io", "futures-util", - "http 1.1.0", + "http", "kitsune-config", "kitsune-db", "kitsune-derive", @@ -3917,9 +3640,9 @@ dependencies = [ "futures-util", "garde", "hex-simd", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.3.1", + "hyper", "img-parts", "iso8601-timestamp", "kitsune-activitypub", @@ -3988,7 +3711,7 @@ dependencies = [ "bytes", "diesel-async", "futures-util", - "http 1.1.0", + "http", "http-body-util", "isolang", "kitsune-config", @@ -4081,9 +3804,9 @@ version = "0.0.1-pre.6" dependencies = [ "async-trait", "futures-util", - "http 1.1.0", + "http", "http-body-util", - "hyper 1.3.1", + "hyper", "kitsune-cache", "kitsune-core", "kitsune-error", @@ -4101,6 +3824,15 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "lasso" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4644821e1c3d7a560fe13d842d13f587c07348a1a05d3a797152d41c90c56df2" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -4144,7 +3876,7 @@ dependencies = [ "percent-encoding", "quoted_printable", "rustls 0.23.5", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "socket2", "tokio", "tokio-rustls 0.26.0", @@ -4297,7 +4029,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.8.3", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -4385,7 +4117,7 @@ name = "masto-id-convert" version = "0.0.1-pre.6" dependencies = [ "atoi_radix10", - "criterion", + "divan", "nanorand", "time", "uuid", @@ -4435,7 +4167,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -4514,7 +4246,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -4604,13 +4336,9 @@ version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" dependencies = [ - "async-lock", - "async-trait", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "event-listener 5.3.0", - "futures-util", "once_cell", "parking_lot 0.12.2", "quanta", @@ -4671,7 +4399,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b99915c25e2b56916308ccd9ca090cb0759226271e5f3b8101e7bbdf7fb8d35" dependencies = [ - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -4684,7 +4412,7 @@ dependencies = [ "mrml-common-macros", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -4696,7 +4424,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.1.0", + "http", "httparse", "memchr", "mime", @@ -4790,7 +4518,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -4813,17 +4541,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -4862,7 +4579,7 @@ dependencies = [ "base64 0.22.1", "chrono", "getrandom 0.2.15", - "http 1.1.0", + "http", "rand 0.8.5", "serde", "serde_json", @@ -4910,12 +4627,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - [[package]] name = "openidconnect" version = "4.0.0-alpha.1" @@ -4927,7 +4638,7 @@ dependencies = [ "dyn-clone", "ed25519-dalek", "hmac", - "http 1.1.0", + "http", "itertools 0.10.5", "log", "oauth2", @@ -4956,8 +4667,7 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "opentelemetry" version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900d57987be3f2aeb70d385fff9b27fb74c5723cc9a52d904d4f9c807a0667bf" +source = "git+https://github.com/open-telemetry/opentelemetry-rust.git?rev=b44cb130e4a102b0d676289e91c003f4b1008d08#b44cb130e4a102b0d676289e91c003f4b1008d08" dependencies = [ "futures-core", "futures-sink", @@ -4965,36 +4675,34 @@ dependencies = [ "once_cell", "pin-project-lite", "thiserror", - "urlencoding", ] [[package]] name = "opentelemetry-http" version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7690dc77bf776713848c4faa6501157469017eaf332baccd4eb1cea928743d94" +source = "git+https://github.com/open-telemetry/opentelemetry-rust.git?rev=b44cb130e4a102b0d676289e91c003f4b1008d08#b44cb130e4a102b0d676289e91c003f4b1008d08" dependencies = [ "async-trait", "bytes", - "http 0.2.12", + "http", "opentelemetry", ] [[package]] name = "opentelemetry-otlp" version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" +source = "git+https://github.com/open-telemetry/opentelemetry-rust.git?rev=b44cb130e4a102b0d676289e91c003f4b1008d08#b44cb130e4a102b0d676289e91c003f4b1008d08" dependencies = [ "async-trait", "futures-core", - "http 0.2.12", + "http", "opentelemetry", "opentelemetry-http", "opentelemetry-proto", "opentelemetry-semantic-conventions", "opentelemetry_sdk", "prost", + "serde_json", "thiserror", "tokio", "tonic", @@ -5003,29 +4711,27 @@ dependencies = [ [[package]] name = "opentelemetry-proto" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" +source = "git+https://github.com/open-telemetry/opentelemetry-rust.git?rev=b44cb130e4a102b0d676289e91c003f4b1008d08#b44cb130e4a102b0d676289e91c003f4b1008d08" dependencies = [ + "hex", "opentelemetry", "opentelemetry_sdk", "prost", + "serde", "tonic", ] [[package]] name = "opentelemetry-semantic-conventions" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910" +source = "git+https://github.com/open-telemetry/opentelemetry-rust.git?rev=b44cb130e4a102b0d676289e91c003f4b1008d08#b44cb130e4a102b0d676289e91c003f4b1008d08" [[package]] name = "opentelemetry_sdk" version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e90c7113be649e31e9a0f8b5ee24ed7a16923b322c3c5ab6367469c049d6b7e" +source = "git+https://github.com/open-telemetry/opentelemetry-rust.git?rev=b44cb130e4a102b0d676289e91c003f4b1008d08#b44cb130e4a102b0d676289e91c003f4b1008d08" dependencies = [ "async-trait", - "crossbeam-channel", "futures-channel", "futures-executor", "futures-util", @@ -5122,7 +4828,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3592c190977a91610618349bd947fec5bf10b2ca1cdc882f6623031de4cd34e1" dependencies = [ - "axum 0.7.5", + "axum", "oxide-auth", ] @@ -5150,12 +4856,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" version = "0.11.2" @@ -5221,16 +4921,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pem" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" -dependencies = [ - "base64 0.22.1", - "serde", -] - [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -5387,7 +5077,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -5434,7 +5124,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -5449,17 +5139,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - [[package]] name = "pkcs1" version = "0.7.5" @@ -5487,40 +5166,12 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" -[[package]] -name = "plotters" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" - -[[package]] -name = "plotters-svg" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" -dependencies = [ - "plotters-backend", -] - [[package]] name = "post-process" version = "0.0.1-pre.6" dependencies = [ - "criterion", - "futures", + "divan", + "futures-executor", "insta", "logos 0.14.0", "pretty_assertions", @@ -5660,7 +5311,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -5900,8 +5551,7 @@ dependencies = [ [[package]] name = "redis" version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6472825949c09872e8f2c50bde59fcefc17748b6be5c90fd67cd8b4daca73bfd" +source = "git+https://github.com/redis-rs/redis-rs.git?rev=0c544b548b52180acda8e8394ab21b2761497e50#0c544b548b52180acda8e8394ab21b2761497e50" dependencies = [ "ahash 0.8.11", "arc-swap", @@ -5911,11 +5561,12 @@ dependencies = [ "futures", "futures-util", "itoa 1.0.11", + "num-bigint", "percent-encoding", "pin-project-lite", "rustls 0.22.4", "rustls-native-certs", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "ryu", "sha1_smol", @@ -5971,7 +5622,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -6010,6 +5661,12 @@ dependencies = [ "regex-syntax 0.8.3", ] +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + [[package]] name = "regex-syntax" version = "0.6.29" @@ -6159,23 +5816,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rsass" -version = "0.28.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf903247e7165156378cd1a7deda977b8e8567683ed97ad7330376dbf92f473" -dependencies = [ - "arc-swap", - "fastrand", - "lazy_static", - "nom", - "num-bigint", - "num-integer", - "num-rational", - "num-traits", - "tracing", -] - [[package]] name = "rust-argon2" version = "1.0.1" @@ -6190,9 +5830,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.3.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb78f46d0066053d16d4ca7b898e9343bc3530f71c61d5ad84cd404ada068745" +checksum = "19549741604902eb99a7ed0ee177a0663ee1eda51a29f71401f166e47e77806a" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -6201,22 +5841,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.3.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91ac2a3c6c0520a3fb3dd89321177c3c692937c4eb21893378219da10c44fc8" +checksum = "cb9f96e283ec64401f30d3df8ee2aaeb2561f34c824381efa24a35f79bf40ee4" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.61", + "syn 2.0.63", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.3.0" +version = "8.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f69089032567ffff4eada41c573fc43ff466c7db7c5688b2e7969584345581" +checksum = "38c74a686185620830701348de757fd36bef4aa9680fd23c49fc539ddcc1af32" dependencies = [ "globset", "sha2", @@ -6259,18 +5899,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.22.4" @@ -6280,7 +5908,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki", "subtle", "zeroize", ] @@ -6295,7 +5923,7 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki", "subtle", "zeroize", ] @@ -6307,21 +5935,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.2" @@ -6338,16 +5957,6 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustls-webpki" version = "0.102.3" @@ -6430,7 +6039,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -6463,16 +6072,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "seahash" version = "4.1.0" @@ -6591,7 +6190,7 @@ checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -6602,7 +6201,7 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -6705,7 +6304,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7032,7 +6631,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7043,7 +6642,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7066,7 +6665,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7109,9 +6708,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.61" +version = "2.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" dependencies = [ "proc-macro2", "quote", @@ -7257,7 +6856,7 @@ checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7274,7 +6873,7 @@ dependencies = [ name = "tick-tock-mock" version = "0.0.1-pre.6" dependencies = [ - "criterion", + "divan", ] [[package]] @@ -7310,16 +6909,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -7335,6 +6924,27 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tls_codec" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e78c9c330f8c85b2bae7c8368f2739157db9991235123aa1b15ef9502bfb6a" +dependencies = [ + "tls_codec_derive", + "zeroize", +] + +[[package]] +name = "tls_codec_derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9ef545650e79f30233c0003bcc2504d7efac6dad25fca40744de773fe2049c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.63", +] + [[package]] name = "tokio" version = "1.37.0" @@ -7354,16 +6964,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.2.0" @@ -7372,7 +6972,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7404,15 +7004,15 @@ dependencies = [ [[package]] name = "tokio-postgres-rustls" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04fb792ccd6bbcd4bba408eb8a292f70fc4a3589e5d793626f45190e6454b6ab" +source = "git+https://github.com/jbg/tokio-postgres-rustls.git?rev=b16c1bc0f5d4f91324174fd1bd839d743a70f86a#b16c1bc0f5d4f91324174fd1bd839d743a70f86a" dependencies = [ + "const-oid", "ring", "rustls 0.23.5", "tokio", "tokio-postgres", "tokio-rustls 0.26.0", - "x509-certificate", + "x509-cert", ] [[package]] @@ -7426,16 +7026,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.25.0" @@ -7570,27 +7160,29 @@ dependencies = [ [[package]] name = "tonic" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +source = "git+https://github.com/hyperium/tonic.git?rev=9b306af386528f11dbd022bc372d367adc4e96b5#9b306af386528f11dbd022bc372d367adc4e96b5" dependencies = [ "async-stream", "async-trait", - "axum 0.6.20", + "axum", "base64 0.21.7", "bytes", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", "prost", + "rustls 0.23.5", "rustls-native-certs", - "rustls-pemfile 2.1.2", - "rustls-pki-types", + "rustls-pemfile", + "socket2", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-stream", "tower", "tower-layer", @@ -7629,8 +7221,8 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "http-range-header", "httpdate", @@ -7656,8 +7248,8 @@ dependencies = [ "bytes", "either", "futures-test", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "memchr", "pin-project-lite", @@ -7687,7 +7279,7 @@ version = "0.0.1-pre.6" dependencies = [ "either", "futures", - "http 1.1.0", + "http", "once_cell", "regex", "tower", @@ -7700,7 +7292,7 @@ name = "tower-x-clacks-overhead" version = "0.0.1-pre.6" dependencies = [ "futures-test", - "http 1.1.0", + "http", "itertools 0.12.1", "pin-project-lite", "tower", @@ -7729,7 +7321,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7778,8 +7370,7 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9be14ba1bbe4ab79e9229f7f89fab8d120b865859f10527f31c033e599d2284" +source = "git+https://github.com/aumetra/tracing-opentelemetry.git?branch=v0.1.x-http1#6f438815e556f95ac15f67c1fe2de395e70a30c3" dependencies = [ "js-sys", "once_cell", @@ -7819,7 +7410,7 @@ version = "0.0.1-pre.6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7848,7 +7439,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http", "httparse", "log", "rand 0.8.5", @@ -7875,7 +7466,7 @@ checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -7905,7 +7496,7 @@ checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -8035,7 +7626,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.61", + "syn 2.0.63", "uuid", ] @@ -8045,7 +7636,7 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b39868d43c011961e04b41623e050aedf2cc93652562ff7935ce0f819aaf2da" dependencies = [ - "axum 0.7.5", + "axum", "mime_guess", "regex", "rust-embed", @@ -8179,7 +7770,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", "wasm-bindgen-shared", ] @@ -8213,7 +7804,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8350,7 +7941,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -8491,7 +8082,7 @@ checksum = "0d3b70422fdfa915c903f003b8b42554a8ae1aa0c6208429d8314ebf5721f3ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -8933,7 +8524,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", "wit-bindgen-core", "wit-bindgen-rust", ] @@ -8985,22 +8576,15 @@ dependencies = [ ] [[package]] -name = "x509-certificate" -version = "0.23.1" +name = "x509-cert" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66534846dec7a11d7c50a74b7cdb208b9a581cad890b7866430d438455847c85" +checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94" dependencies = [ - "bcder", - "bytes", - "chrono", + "const-oid", "der", - "hex", - "pem", - "ring", - "signature", "spki", - "thiserror", - "zeroize", + "tls_codec", ] [[package]] @@ -9054,7 +8638,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] @@ -9074,7 +8658,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 2.0.63", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1267c730b..f56797117 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,6 @@ members = [ "lib/blowocking", "lib/cursiv", "lib/geomjeungja", - "lib/http-compat", "lib/http-signatures", "lib/just-retry", "lib/masto-id-convert", @@ -125,3 +124,15 @@ install-updater = true [patch.crates-io] diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "d02798c67065d763154d7272dd0c09b39757d0f2" } scraper = { git = "https://github.com/causal-agent/scraper.git", rev = "d67111f5cc0b7da6e6ff10e4549d87cf09ba3e5b" } +tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", rev = "b16c1bc0f5d4f91324174fd1bd839d743a70f86a" } + +# Support XAUTOCLAIM +redis = { git = "https://github.com/redis-rs/redis-rs.git", rev = "0c544b548b52180acda8e8394ab21b2761497e50" } + +# Patch to make OpenTelemetry with with hyper 1 +opentelemetry = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" } +opentelemetry-http = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" } +opentelemetry-otlp = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" } +opentelemetry_sdk = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" } +tonic = { git = "https://github.com/hyperium/tonic.git", rev = "9b306af386528f11dbd022bc372d367adc4e96b5" } +tracing-opentelemetry = { git = "https://github.com/aumetra/tracing-opentelemetry.git", branch = "v0.1.x-http1" } diff --git a/crates/kitsune-cache/Cargo.toml b/crates/kitsune-cache/Cargo.toml index f1b5e862c..c66680566 100644 --- a/crates/kitsune-cache/Cargo.toml +++ b/crates/kitsune-cache/Cargo.toml @@ -8,7 +8,7 @@ license.workspace = true [dependencies] enum_dispatch = "0.3.13" kitsune-error = { path = "../kitsune-error" } -moka = { version = "0.12.7", features = ["future"] } +moka = { version = "0.12.7", features = ["sync"] } multiplex-pool = { path = "../../lib/multiplex-pool" } redis = { version = "0.25.3", default-features = false, features = [ "connection-manager", diff --git a/crates/kitsune-cache/src/in_memory.rs b/crates/kitsune-cache/src/in_memory.rs index 53ef33c94..f7f012955 100644 --- a/crates/kitsune-cache/src/in_memory.rs +++ b/crates/kitsune-cache/src/in_memory.rs @@ -1,6 +1,6 @@ use crate::CacheBackend; use kitsune_error::Result; -use moka::future::Cache; +use moka::sync::Cache; use std::{fmt::Display, marker::PhantomData, time::Duration}; pub struct InMemory @@ -36,16 +36,16 @@ where V: Clone + Send + Sync + 'static, { async fn delete(&self, key: &K) -> Result<()> { - self.inner.remove(&key.to_string()).await; + self.inner.remove(&key.to_string()); Ok(()) } async fn get(&self, key: &K) -> Result> { - Ok(self.inner.get(&key.to_string()).await) + Ok(self.inner.get(&key.to_string())) } async fn set(&self, key: &K, value: &V) -> Result<()> { - self.inner.insert(key.to_string(), value.clone()).await; + self.inner.insert(key.to_string(), value.clone()); Ok(()) } } @@ -70,7 +70,7 @@ mod test { cache.set(&"hello", &"world").await.unwrap(); cache.set(&"another", &"pair").await.unwrap(); - cache.inner.run_pending_tasks().await; + cache.inner.run_pending_tasks(); assert_eq!(cache.inner.entry_count(), 1); } diff --git a/crates/kitsune-derive/impl/Cargo.toml b/crates/kitsune-derive/impl/Cargo.toml index 8e90c1e20..431dcbac8 100644 --- a/crates/kitsune-derive/impl/Cargo.toml +++ b/crates/kitsune-derive/impl/Cargo.toml @@ -11,7 +11,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.82" quote = "1.0.36" -syn = { version = "2.0.61", features = ["full"] } +syn = { version = "2.0.63", features = ["full"] } [lints] workspace = true diff --git a/crates/kitsune-observability/Cargo.toml b/crates/kitsune-observability/Cargo.toml index d206ffc86..2bd58ce84 100644 --- a/crates/kitsune-observability/Cargo.toml +++ b/crates/kitsune-observability/Cargo.toml @@ -9,7 +9,6 @@ license.workspace = true async-trait = "0.1.80" eyre = "0.6.12" http-body-util = "0.1.1" -http-compat = { path = "../../lib/http-compat" } hyper = { version = "1.3.1", default-features = false } kitsune-config = { path = "../kitsune-config" } kitsune-http-client = { path = "../kitsune-http-client" } @@ -19,6 +18,7 @@ opentelemetry = { version = "0.22.0", default-features = false, features = [ opentelemetry-http = "0.11.1" opentelemetry-otlp = { version = "0.15.0", default-features = false, features = [ "grpc-tonic", + "http-json", "http-proto", "tls", "tls-roots", diff --git a/crates/kitsune-observability/src/lib.rs b/crates/kitsune-observability/src/lib.rs index b1bb2147f..47879e081 100644 --- a/crates/kitsune-observability/src/lib.rs +++ b/crates/kitsune-observability/src/lib.rs @@ -1,7 +1,6 @@ use async_trait::async_trait; use eyre::WrapErr; use http_body_util::BodyExt; -use http_compat::Compat; use kitsune_config::{open_telemetry::Transport, Configuration}; use opentelemetry::trace::{noop::NoopTracer, Tracer}; use opentelemetry_http::{Bytes, HttpClient, HttpError, Request, Response}; @@ -34,12 +33,12 @@ impl HttpClient for HttpClientAdapter { let (parts, body) = request.into_parts(); let request = Request::from_parts(parts, body.into()); - let response = self.inner.execute(request.compat()).await?.into_inner(); + let response = self.inner.execute(request).await?.into_inner(); let (parts, body) = response.into_parts(); let body = body.collect().await?.to_bytes(); - Ok(hyper::http::Response::from_parts(parts, body).compat()) + Ok(hyper::http::Response::from_parts(parts, body)) } } diff --git a/crates/kitsune-oidc/Cargo.toml b/crates/kitsune-oidc/Cargo.toml index a140b4797..cc00ba71b 100644 --- a/crates/kitsune-oidc/Cargo.toml +++ b/crates/kitsune-oidc/Cargo.toml @@ -13,7 +13,7 @@ kitsune-config = { path = "../kitsune-config" } kitsune-derive = { path = "../kitsune-derive" } kitsune-error = { path = "../kitsune-error" } kitsune-http-client = { path = "../kitsune-http-client" } -moka = { version = "0.12.7", features = ["future"] } +moka = { version = "0.12.7", features = ["sync"] } multiplex-pool = { path = "../../lib/multiplex-pool" } oauth2 = { version = "5.0.0-alpha.4", default-features = false } once_cell = "1.19.0" diff --git a/crates/kitsune-oidc/src/state/store/in_memory.rs b/crates/kitsune-oidc/src/state/store/in_memory.rs index e0ee0afef..e2e4594c3 100644 --- a/crates/kitsune-oidc/src/state/store/in_memory.rs +++ b/crates/kitsune-oidc/src/state/store/in_memory.rs @@ -1,7 +1,7 @@ use super::Store; use crate::state::LoginState; use kitsune_error::{kitsune_error, ErrorType, Result}; -use moka::future::Cache; +use moka::sync::Cache; #[derive(Clone)] pub struct InMemory { @@ -20,12 +20,11 @@ impl Store for InMemory { async fn get_and_remove(&self, key: &str) -> Result { self.inner .remove(key) - .await .ok_or_else(|| kitsune_error!(type = ErrorType::BadRequest, "missing login state")) } async fn set(&self, key: &str, value: LoginState) -> Result<()> { - self.inner.insert(key.to_string(), value).await; + self.inner.insert(key.to_string(), value); Ok(()) } } diff --git a/crates/kitsune-scss-compiler/Cargo.toml b/crates/kitsune-scss-compiler/Cargo.toml index d6c9158d4..1ea5e20cd 100644 --- a/crates/kitsune-scss-compiler/Cargo.toml +++ b/crates/kitsune-scss-compiler/Cargo.toml @@ -6,9 +6,9 @@ version.workspace = true license.workspace = true [dependencies] -anyhow = "1.0.83" +eyre = "0.6.12" glob = "0.3.1" -rsass = "0.28.8" +grass_compiler = "0.13.2" tracing = { version = "0.1.40", default-features = false } [lints] diff --git a/crates/kitsune-scss-compiler/src/lib.rs b/crates/kitsune-scss-compiler/src/lib.rs index cc911afe6..7199b8599 100644 --- a/crates/kitsune-scss-compiler/src/lib.rs +++ b/crates/kitsune-scss-compiler/src/lib.rs @@ -1,6 +1,6 @@ -use anyhow::Result; +use eyre::Result; use glob::glob; -use rsass::output::{Format, Style}; +use grass_compiler::{Options, OutputStyle}; use std::{fs, path::Path}; pub fn compile

(path: P) -> Result<()> @@ -8,17 +8,14 @@ where P: AsRef, { let path = path.as_ref(); - let scss_format = Format { - style: Style::Compressed, - ..Default::default() - }; + let scss_options = Options::default().style(OutputStyle::Compressed); let pattern = format!("{}/*.scss", path.display()); for file in glob(&pattern)? { let mut path = file?; tracing::info!("Compiling \"{}\" into CSS", path.display()); - let compiled_css = rsass::compile_scss_path(&path, scss_format)?; + let compiled_css = grass_compiler::from_path(&path, &scss_options)?; path.set_extension("css"); fs::write(path, compiled_css)?; } diff --git a/kitsune-cli/Cargo.toml b/kitsune-cli/Cargo.toml index 1d6e50d16..03212e3f8 100644 --- a/kitsune-cli/Cargo.toml +++ b/kitsune-cli/Cargo.toml @@ -4,7 +4,6 @@ version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true -build = "build.rs" [package.metadata.wix] upgrade-guid = "566D09AC-E247-4490-B8BB-A16DB4E225DF" @@ -20,6 +19,7 @@ diesel-async = "0.4.1" dotenvy = "0.15.7" envy = "0.4.2" kitsune-config = { path = "../crates/kitsune-config" } +kitsune-core = { version = "0.0.1-pre.6", path = "../crates/kitsune-core" } kitsune-db = { path = "../crates/kitsune-db" } kitsune-error = { path = "../crates/kitsune-error" } serde = { version = "1.0.201", features = ["derive"] } diff --git a/kitsune-cli/build.rs b/kitsune-cli/build.rs deleted file mode 100644 index 7bd299f6c..000000000 --- a/kitsune-cli/build.rs +++ /dev/null @@ -1,9 +0,0 @@ -use vergen::EmitBuilder; - -fn main() { - EmitBuilder::builder() - .all_git() - .git_sha(true) - .emit_and_set() - .unwrap(); -} diff --git a/kitsune-cli/src/main.rs b/kitsune-cli/src/main.rs index bef612589..659ae2cb1 100644 --- a/kitsune-cli/src/main.rs +++ b/kitsune-cli/src/main.rs @@ -2,6 +2,7 @@ use self::{config::Configuration, role::RoleSubcommand}; use clap::{Parser, Subcommand}; use color_eyre::eyre::Result; use kitsune_config::database::Configuration as DatabaseConfig; +use kitsune_core::consts::VERSION; mod config; mod role; @@ -15,7 +16,7 @@ enum AppSubcommand { /// CLI for the Kitsune social media server #[derive(Parser)] -#[command(about, author, version = concat!(env!("CARGO_PKG_VERSION"), "-", env!("VERGEN_GIT_SHA")))] +#[command(about, author, version = VERSION)] struct App { #[clap(subcommand)] subcommand: AppSubcommand, diff --git a/kitsune/Cargo.toml b/kitsune/Cargo.toml index b4a284182..c46749763 100644 --- a/kitsune/Cargo.toml +++ b/kitsune/Cargo.toml @@ -78,7 +78,7 @@ oxide-auth-axum = "0.4.0" redis = { version = "0.25.3", default-features = false, features = [ "tokio-rustls-comp", ] } -rust-embed = { version = "8.3.0", features = ["include-exclude"] } +rust-embed = { version = "8.4.0", features = ["include-exclude"] } scoped-futures = "0.1.3" serde = { version = "1.0.201", features = ["derive"] } serde_urlencoded = "0.7.1" @@ -89,7 +89,7 @@ strum = { version = "0.26.2", features = ["derive", "phf"] } tempfile = "3.10.1" time = "0.3.36" tokio = { version = "1.37.0", features = ["full"] } -tokio-util = { version = "0.7.11", features = ["compat"] } +tokio-util = { version = "0.7.11", features = ["io"] } tower = { version = "0.4.13", features = ["util"] } tower-stop-using-brave = { path = "../lib/tower-stop-using-brave" } tower-x-clacks-overhead = { path = "../lib/tower-x-clacks-overhead" } @@ -118,7 +118,6 @@ async-graphql = { version = "7.0.5", default-features = false, features = [ "tempfile", "time", "tracing", - "unblock", "uuid", ], optional = true } async-graphql-axum = { version = "7.0.5", optional = true } diff --git a/kitsune/src/http/graphql/mutation/mod.rs b/kitsune/src/http/graphql/mutation/mod.rs index 4c0966360..679c47f05 100644 --- a/kitsune/src/http/graphql/mutation/mod.rs +++ b/kitsune/src/http/graphql/mutation/mod.rs @@ -6,7 +6,8 @@ use futures_util::{Stream, TryStreamExt}; use kitsune_service::attachment; use mime::Mime; use std::str::FromStr; -use tokio_util::{compat::FuturesAsyncReadCompatExt, io::ReaderStream}; +use tokio::fs::File; +use tokio_util::io::ReaderStream; mod auth; mod post; @@ -29,7 +30,7 @@ fn handle_upload( .or_else(|| mime_guess::from_path(&value.filename).first()) .ok_or_else(|| Error::new("Failed to determine file type"))?; - let stream = ReaderStream::new(value.into_async_read().compat()).map_err(Into::into); + let stream = ReaderStream::new(File::from_std(value.content)).map_err(Into::into); let mut upload = attachment::Upload::builder() .account_id(user_data.account.id) .content_type(content_type.as_ref().into()) diff --git a/lib/athena/src/common.rs b/lib/athena/src/common.rs index 992590d6f..2d3e4bceb 100644 --- a/lib/athena/src/common.rs +++ b/lib/athena/src/common.rs @@ -3,7 +3,7 @@ use crate::{ error::{Error, Result}, JobContextRepository, JobData, JobQueue, JobResult, Outcome, Runnable, }; -use ahash::AHashMap; +use ahash::HashMap; use futures_util::TryStreamExt; use just_retry::RetryExt; use speedy_uuid::Uuid; @@ -40,7 +40,7 @@ where let job_data = job_data .into_iter() .map(|data| (data.job_id, data)) - .collect::>(); + .collect::>(); let job_data = Arc::new(job_data); while let Some((job_id, job_ctx)) = context_stream diff --git a/lib/athena/src/redis/mod.rs b/lib/athena/src/redis/mod.rs index dd9f30340..420cb4074 100644 --- a/lib/athena/src/redis/mod.rs +++ b/lib/athena/src/redis/mod.rs @@ -1,4 +1,4 @@ -use self::{scheduled::ScheduledJobActor, util::StreamAutoClaimReply}; +use self::scheduled::ScheduledJobActor; use crate::{ consts::{BLOCK_TIME, MAX_RETRIES, MIN_IDLE_TIME}, error::Result, @@ -13,7 +13,7 @@ use just_retry::{ }; use redis::{ aio::ConnectionLike, - streams::{StreamReadOptions, StreamReadReply}, + streams::{StreamAutoClaimOptions, StreamAutoClaimReply, StreamReadOptions, StreamReadReply}, AsyncCommands, RedisResult, }; use smol_str::SmolStr; @@ -24,7 +24,6 @@ use triomphe::Arc; use typed_builder::TypedBuilder; mod scheduled; -mod util; type Pool = multiplex_pool::Pool; @@ -154,17 +153,19 @@ where let mut redis_conn = self.redis_pool.get(); self.initialise_group(&mut redis_conn).await?; - let StreamAutoClaimReply { claimed_ids, .. }: StreamAutoClaimReply = - redis::cmd("XAUTOCLAIM") - .arg(self.queue_name.as_str()) - .arg(self.consumer_group.as_str()) - .arg(self.consumer_name.as_str()) - .arg(MIN_IDLE_TIME.as_millis() as u64) - .arg("0-0") - .arg("COUNT") - .arg(max_jobs) - .query_async(&mut redis_conn) - .await?; + let StreamAutoClaimReply { + claimed: claimed_ids, + .. + } = redis_conn + .xautoclaim_options( + self.queue_name.as_str(), + self.consumer_group.as_str(), + self.consumer_name.as_str(), + MIN_IDLE_TIME.as_millis() as u64, + "0-0", + StreamAutoClaimOptions::default().count(max_jobs), + ) + .await?; let claimed_ids = if claimed_ids.len() == max_jobs { Either::Left(claimed_ids.into_iter()) diff --git a/lib/athena/src/redis/util.rs b/lib/athena/src/redis/util.rs deleted file mode 100644 index df33de218..000000000 --- a/lib/athena/src/redis/util.rs +++ /dev/null @@ -1,27 +0,0 @@ -use ahash::AHashMap; -use redis::{streams::StreamId, FromRedisValue, RedisResult}; - -#[derive(Clone, Debug)] -pub struct StreamAutoClaimReply { - pub claimed_ids: Vec, -} - -impl FromRedisValue for StreamAutoClaimReply { - fn from_redis_value(v: &redis::Value) -> RedisResult { - type AutoClaimReturnValue = ( - String, - Vec)>>, - Vec, - ); - - let (_start_stream_id, claimed_ids, _deleted_ids): AutoClaimReturnValue = - redis::from_redis_value(v)?; - - let claimed_ids: Vec = claimed_ids - .into_iter() - .flat_map(|row| row.into_iter().map(|(id, map)| StreamId { id, map })) - .collect(); - - Ok(Self { claimed_ids }) - } -} diff --git a/lib/cursiv/Cargo.toml b/lib/cursiv/Cargo.toml index a796008fc..efa3d3c28 100644 --- a/lib/cursiv/Cargo.toml +++ b/lib/cursiv/Cargo.toml @@ -14,12 +14,12 @@ http = "1.1.0" pin-project-lite = "0.2.14" rand = "0.8.5" tower = { version = "0.4.13", default-features = false } +triomphe = "0.1.11" zeroize = { version = "1.7.0", features = ["derive"] } # `axum` feature async-trait = { version = "0.1.80", optional = true } axum-core = { version = "0.4.3", optional = true } -triomphe = "0.1.11" [dev-dependencies] futures-test = "0.3.30" diff --git a/lib/geomjeungja/Cargo.toml b/lib/geomjeungja/Cargo.toml index 83a5ab177..fdedd9171 100644 --- a/lib/geomjeungja/Cargo.toml +++ b/lib/geomjeungja/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] async-trait = "0.1.80" -hickory-resolver = { version = "0.24.1", features = ["dns-over-rustls"] } +hickory-resolver = "0.24.1" rand = "0.8.5" serde = { version = "1.0.201", features = ["derive"] } simdutf8 = { version = "0.1.4", features = ["aarch64_neon"] } diff --git a/lib/http-compat/Cargo.toml b/lib/http-compat/Cargo.toml deleted file mode 100644 index 760c7d238..000000000 --- a/lib/http-compat/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "http-compat" -authors.workspace = true -edition.workspace = true -version.workspace = true -license = "MIT OR Apache-2.0" - -[dependencies] -http02 = { package = "http", version = "0.2.12" } -http1 = { package = "http", version = "1.1.0" } - -[lints] -workspace = true diff --git a/lib/http-compat/LICENSE-APACHE-2.0 b/lib/http-compat/LICENSE-APACHE-2.0 deleted file mode 120000 index bffaaba2f..000000000 --- a/lib/http-compat/LICENSE-APACHE-2.0 +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE-APACHE-2.0 \ No newline at end of file diff --git a/lib/http-compat/LICENSE-MIT b/lib/http-compat/LICENSE-MIT deleted file mode 120000 index b2cfbdc7b..000000000 --- a/lib/http-compat/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../../LICENSE-MIT \ No newline at end of file diff --git a/lib/http-compat/src/lib.rs b/lib/http-compat/src/lib.rs deleted file mode 100644 index 0df98df32..000000000 --- a/lib/http-compat/src/lib.rs +++ /dev/null @@ -1,8 +0,0 @@ -mod v0_2; -mod v1; - -pub trait Compat { - type Output; - - fn compat(self) -> Self::Output; -} diff --git a/lib/http-compat/src/v0_2.rs b/lib/http-compat/src/v0_2.rs deleted file mode 100644 index 2656d59c2..000000000 --- a/lib/http-compat/src/v0_2.rs +++ /dev/null @@ -1,74 +0,0 @@ -use crate::Compat; -use std::str::FromStr; - -impl Compat for http02::HeaderName { - type Output = http1::HeaderName; - - fn compat(self) -> Self::Output { - http1::HeaderName::from_bytes(self.as_str().as_bytes()).unwrap() - } -} - -impl Compat for http02::HeaderValue { - type Output = http1::HeaderValue; - - fn compat(self) -> Self::Output { - http1::HeaderValue::from_bytes(self.as_bytes()).unwrap() - } -} - -impl Compat for http02::HeaderMap { - type Output = http1::HeaderMap; - - fn compat(self) -> Self::Output { - self.iter() - .map(|(name, value)| (name.clone().compat(), value.clone().compat())) - .collect() - } -} - -impl Compat for http02::Method { - type Output = http1::Method; - - fn compat(self) -> Self::Output { - http1::Method::from_bytes(self.as_str().as_bytes()).unwrap() - } -} - -impl Compat for http02::Request { - type Output = http1::Request; - - fn compat(self) -> Self::Output { - let (parts, body) = self.into_parts(); - let mut req_builder = http1::Request::builder() - .method(parts.method.compat()) - .uri(parts.uri.compat()) - .version(parts.version.compat()); - *req_builder.headers_mut().unwrap() = parts.headers.compat(); - - req_builder.body(body).unwrap() - } -} - -impl Compat for http02::Uri { - type Output = http1::Uri; - - fn compat(self) -> Self::Output { - http1::Uri::from_str(&self.to_string()).unwrap() - } -} - -impl Compat for http02::Version { - type Output = http1::Version; - - fn compat(self) -> Self::Output { - match self { - http02::Version::HTTP_09 => http1::Version::HTTP_09, - http02::Version::HTTP_10 => http1::Version::HTTP_10, - http02::Version::HTTP_11 => http1::Version::HTTP_11, - http02::Version::HTTP_2 => http1::Version::HTTP_2, - http02::Version::HTTP_3 => http1::Version::HTTP_3, - _ => unreachable!(), - } - } -} diff --git a/lib/http-compat/src/v1.rs b/lib/http-compat/src/v1.rs deleted file mode 100644 index 59734ecba..000000000 --- a/lib/http-compat/src/v1.rs +++ /dev/null @@ -1,64 +0,0 @@ -use crate::Compat; - -impl Compat for http1::HeaderName { - type Output = http02::HeaderName; - - fn compat(self) -> Self::Output { - http02::HeaderName::from_bytes(self.as_str().as_bytes()).unwrap() - } -} - -impl Compat for http1::HeaderValue { - type Output = http02::HeaderValue; - - fn compat(self) -> Self::Output { - http02::HeaderValue::from_bytes(self.as_bytes()).unwrap() - } -} - -impl Compat for http1::HeaderMap { - type Output = http02::HeaderMap; - - fn compat(self) -> Self::Output { - self.iter() - .map(|(name, value)| (name.clone().compat(), value.clone().compat())) - .collect() - } -} - -impl Compat for http1::Response { - type Output = http02::Response; - - fn compat(self) -> Self::Output { - let (parts, body) = self.into_parts(); - let mut res_builder = http02::Response::builder() - .status(parts.status.compat()) - .version(parts.version.compat()); - *res_builder.headers_mut().unwrap() = parts.headers.compat(); - - res_builder.body(body).unwrap() - } -} - -impl Compat for http1::StatusCode { - type Output = http02::StatusCode; - - fn compat(self) -> Self::Output { - http02::StatusCode::from_u16(self.as_u16()).unwrap() - } -} - -impl Compat for http1::Version { - type Output = http02::Version; - - fn compat(self) -> Self::Output { - match self { - http1::Version::HTTP_09 => http02::Version::HTTP_09, - http1::Version::HTTP_10 => http02::Version::HTTP_10, - http1::Version::HTTP_11 => http02::Version::HTTP_11, - http1::Version::HTTP_2 => http02::Version::HTTP_2, - http1::Version::HTTP_3 => http02::Version::HTTP_3, - _ => unreachable!(), - } - } -} diff --git a/lib/http-signatures/Cargo.toml b/lib/http-signatures/Cargo.toml index 770e9978c..6d037d282 100644 --- a/lib/http-signatures/Cargo.toml +++ b/lib/http-signatures/Cargo.toml @@ -36,7 +36,7 @@ tick-tock-mock = { path = "../tick-tock-mock" } tracing = { version = "0.1.40", default-features = false, optional = true } [dev-dependencies] -criterion = "0.5.1" +divan = "0.1.14" tokio = { version = "1.37.0", features = ["macros", "rt"] } [features] diff --git a/lib/http-signatures/benches/build_cavage_signature_string.rs b/lib/http-signatures/benches/build_cavage_signature_string.rs index f1ced8dae..b6c555883 100644 --- a/lib/http-signatures/benches/build_cavage_signature_string.rs +++ b/lib/http-signatures/benches/build_cavage_signature_string.rs @@ -1,11 +1,15 @@ -use criterion::{criterion_group, criterion_main, Criterion}; +use divan::Bencher; use http::{Method, Request, Uri}; use std::hint::black_box; +#[global_allocator] +static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system(); + const CAVAGE_HEADER: &str = r#"keyId="Test",algorithm="rsa-sha256",headers="(request-target) host date",signature="qdx""#; -fn build_cavage_signature_string1(c: &mut Criterion) { +#[divan::bench] +fn build_cavage_signature_string(bencher: Bencher<'_, '_>) { let signature_header = http_signatures::cavage::parse(CAVAGE_HEADER).unwrap(); let request = Request::builder() .method(Method::GET) @@ -21,18 +25,14 @@ fn build_cavage_signature_string1(c: &mut Criterion) { .body(()) .unwrap(); - c.bench_function("build_cavage_signature_string", |b| { - b.iter(|| { - let _ = black_box(http_signatures::cavage::signature_string::construct( - black_box(&request), - black_box(&signature_header), - )); - }); + bencher.bench(|| { + http_signatures::cavage::signature_string::construct( + black_box(&request), + black_box(&signature_header), + ) }); } -criterion_group!( - build_cavage_signature_string, - build_cavage_signature_string1 -); -criterion_main!(build_cavage_signature_string); +fn main() { + divan::main(); +} diff --git a/lib/http-signatures/benches/parse_cavage_header.rs b/lib/http-signatures/benches/parse_cavage_header.rs index 5bfee791a..4ae4f3824 100644 --- a/lib/http-signatures/benches/parse_cavage_header.rs +++ b/lib/http-signatures/benches/parse_cavage_header.rs @@ -1,25 +1,17 @@ -use criterion::{criterion_group, criterion_main, Criterion}; +use divan::black_box_drop; use http_signatures::cavage; -use std::hint::black_box; + +#[global_allocator] +static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system(); const CAVAGE_HEADER_1: &str = r#"keyId="Test",algorithm="rsa-sha256",headers="(request-target) host date",signature="qdx+H7PHHDZgy4y/Ahn9Tny9V3GP6YgBPyUXMmoxWtLbHpUnXS2mg2+SbrQDMCJypxBLSPQR2aAjn7ndmw2iicw3HMbe8VfEdKFYRqzic+efkb3nndiv/x1xSHDJWeSWkx3ButlYSuBskLu6kd9Fswtemr3lgdDEmn04swr2Os0=""#; const CAVAGE_HEADER_2: &str = r#"keyId="Test",algorithm="rsa-sha256",created=1402170695, expires=1402170699,headers="(request-target) (created) (expires) host date content-type digest content-length",signature="vSdrb+dS3EceC9bcwHSo4MlyKS59iFIrhgYkz8+oVLEEzmYZZvRs8rgOp+63LEM3v+MFHB32NfpB2bEKBIvB1q52LaEUHFv120V01IL+TAD48XaERZFukWgHoBTLMhYS2Gb51gWxpeIq8knRmPnYePbF5MOkR0Zkly4zKH7s1dE=""#; -fn header1(c: &mut Criterion) { - c.bench_function("parse_cavage_header1", |b| { - b.iter(|| { - let _ = black_box(cavage::parse(black_box(CAVAGE_HEADER_1))); - }); - }); +#[divan::bench(args = [CAVAGE_HEADER_1, CAVAGE_HEADER_2])] +fn parse_cavage_header(header: &str) { + black_box_drop(cavage::parse(header)); } -fn header2(c: &mut Criterion) { - c.bench_function("parse_cavage_header2", |b| { - b.iter(|| { - let _ = black_box(cavage::parse(black_box(CAVAGE_HEADER_2))); - }); - }); +fn main() { + divan::main(); } - -criterion_group!(parse_cavage_header, header1, header2); -criterion_main!(parse_cavage_header); diff --git a/lib/masto-id-convert/Cargo.toml b/lib/masto-id-convert/Cargo.toml index 2445b826b..67e5ff806 100644 --- a/lib/masto-id-convert/Cargo.toml +++ b/lib/masto-id-convert/Cargo.toml @@ -21,7 +21,7 @@ default = ["std"] std = [] [dev-dependencies] -criterion = "0.5.1" +divan = "0.1.14" time = "0.3.36" uuid = { version = "1.8.0", features = ["v7"] } diff --git a/lib/masto-id-convert/benches/process.rs b/lib/masto-id-convert/benches/process.rs index df813bf96..31174c667 100644 --- a/lib/masto-id-convert/benches/process.rs +++ b/lib/masto-id-convert/benches/process.rs @@ -1,17 +1,20 @@ #![allow(clippy::unreadable_literal)] -use criterion::{criterion_group, criterion_main, Criterion}; -use std::hint::black_box; +use divan::black_box_drop; -fn process_bench(c: &mut Criterion) { - c.bench_function("process integer 110368129515784116", |b| { - b.iter(|| masto_id_convert::process_u64(black_box(110368129515784116))); - }); +#[global_allocator] +static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system(); - c.bench_function("process ASCII 110368129515784116", |b| { - b.iter(|| masto_id_convert::process(black_box("110368129515784116"))); - }); +#[divan::bench(name = "process integer", args = [110368129515784116])] +fn process_u64(id: u64) { + black_box_drop(masto_id_convert::process_u64(id)); } -criterion_group!(benches, process_bench); -criterion_main!(benches); +#[divan::bench(name = "process ASCII", args = ["110368129515784116"])] +fn process_ascii(id: &str) { + black_box_drop(masto_id_convert::process(id)); +} + +fn main() { + divan::main(); +} diff --git a/lib/post-process/Cargo.toml b/lib/post-process/Cargo.toml index 8af336bde..77c1e7060 100644 --- a/lib/post-process/Cargo.toml +++ b/lib/post-process/Cargo.toml @@ -13,8 +13,8 @@ harness = false logos = "0.14.0" [dev-dependencies] -criterion = { version = "0.5.1", features = ["async_futures"] } -futures = "0.3.30" +divan = "0.1.14" +futures-executor = "0.3.30" insta = { version = "1.38.0", features = ["glob"] } pretty_assertions = "1.4.0" diff --git a/lib/post-process/benches/simple.rs b/lib/post-process/benches/simple.rs index ff673b5a5..0d5c9f999 100644 --- a/lib/post-process/benches/simple.rs +++ b/lib/post-process/benches/simple.rs @@ -1,16 +1,20 @@ -use criterion::{async_executor::FuturesExecutor, criterion_group, criterion_main, Criterion}; -use futures::future; -use std::hint::black_box; +use divan::black_box; +use futures_executor::block_on; +use std::future; + +#[global_allocator] +static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system(); const SIMPLE_POST: &str = "Hello, #World! This is a benchmark for the post transformer of @kitsune"; -fn simple_bench(c: &mut Criterion) { - c.bench_function("simple_transform", |b| { - b.to_async(FuturesExecutor).iter(|| async { - post_process::transform(black_box(SIMPLE_POST), black_box(future::ok)).await - }); - }); +#[divan::bench(args = [SIMPLE_POST])] +fn simple_bench(post: &str) -> post_process::Result { + block_on(post_process::transform( + post, + black_box(|item| future::ready(Ok(item))), + )) } -criterion_group!(simple, simple_bench); -criterion_main!(simple); +fn main() { + divan::main(); +} diff --git a/lib/post-process/tests/transformation.rs b/lib/post-process/tests/transformation.rs index 3667e4a40..723dfc8ee 100644 --- a/lib/post-process/tests/transformation.rs +++ b/lib/post-process/tests/transformation.rs @@ -1,7 +1,7 @@ -use futures::{executor::block_on, future}; +use futures_executor::block_on; use post_process::{Element, Html}; use pretty_assertions::assert_eq; -use std::borrow::Cow; +use std::{borrow::Cow, future}; #[test] fn link_transformation() { @@ -49,7 +49,10 @@ fn link_transformation() { #[test] fn noop_transformation() { let text = "@真島@goro.org how are you doing? :friday-night: #龍が如く0"; - let transformed = block_on(post_process::transform(text, future::ok)).unwrap(); + let transformed = block_on(post_process::transform(text, |item| { + future::ready(Ok(item)) + })) + .unwrap(); assert_eq!(text, transformed); } diff --git a/lib/tick-tock-mock/Cargo.toml b/lib/tick-tock-mock/Cargo.toml index 303d162b6..5daa634c9 100644 --- a/lib/tick-tock-mock/Cargo.toml +++ b/lib/tick-tock-mock/Cargo.toml @@ -12,7 +12,7 @@ harness = false [dependencies] [dev-dependencies] -criterion = "0.5.1" +divan = "0.1.14" [lints] workspace = true diff --git a/lib/tick-tock-mock/benches/simple_now.rs b/lib/tick-tock-mock/benches/simple_now.rs index b824f98c6..7ca2f9685 100644 --- a/lib/tick-tock-mock/benches/simple_now.rs +++ b/lib/tick-tock-mock/benches/simple_now.rs @@ -1,33 +1,43 @@ -use criterion::{criterion_group, criterion_main, Criterion}; -use std::{ - hint::black_box, - time::{Duration, SystemTime}, -}; -use tick_tock_mock::{Clock, DeltaDirection}; - -fn simple_now_mock(c: &mut Criterion) { - let clock = Clock::new(); - c.bench_function("simple_now_mock", |b| { - b.iter(|| black_box(clock.now())); - }); - - c.bench_function("simple_now_mock_tl", |b| { - b.iter(|| black_box(tick_tock_mock::now())); - }); - - let (clock, mock) = Clock::mockable(); - mock.adjust(DeltaDirection::Add, Duration::from_secs(1)); - - c.bench_function("simple_now_mock_adjust", |b| { - b.iter(|| black_box(clock.now())); - }); +#[global_allocator] +static GLOBAL: divan::AllocProfiler = divan::AllocProfiler::system(); + +#[divan::bench_group] +mod std { + use divan::black_box; + use std::time::SystemTime; + + #[divan::bench] + fn systemtime_now() -> SystemTime { + black_box(SystemTime::now()) + } } -fn simple_now_std(c: &mut Criterion) { - c.bench_function("simple_now_std", |b| { - b.iter(|| black_box(SystemTime::now())); - }); +#[divan::bench_group] +mod tick_tock_mock { + use divan::{black_box, Bencher}; + use std::time::{Duration, SystemTime}; + use tick_tock_mock::{Clock, DeltaDirection}; + + #[divan::bench] + fn now_thread_local() -> SystemTime { + black_box(tick_tock_mock::now()) + } + + #[divan::bench] + fn now(bencher: Bencher<'_, '_>) { + let clock = Clock::new(); + bencher.bench(|| black_box(clock.now())); + } + + #[divan::bench] + fn now_mocked(bencher: Bencher<'_, '_>) { + let (clock, mock) = Clock::mockable(); + mock.adjust(DeltaDirection::Add, Duration::from_secs(1)); + + bencher.bench(|| black_box(clock.now())); + } } -criterion_group!(simple_now, simple_now_mock, simple_now_std); -criterion_main!(simple_now); +fn main() { + divan::main(); +} diff --git a/lib/trials/macros/Cargo.toml b/lib/trials/macros/Cargo.toml index a5544a541..f27251db0 100644 --- a/lib/trials/macros/Cargo.toml +++ b/lib/trials/macros/Cargo.toml @@ -11,7 +11,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.82" quote = "1.0.36" -syn = { version = "2.0.61", features = ["full", "visit-mut"] } +syn = { version = "2.0.63", features = ["full", "visit-mut"] } [lints] workspace = true