diff --git a/Cargo.lock b/Cargo.lock index 416c4887b..1d7c8e7ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,7 +71,7 @@ dependencies = [ "measureme 10.1.3", "measureme 12.0.3", "memchr", - "rustc-hash", + "rustc-hash 1.1.0", "serde", ] @@ -209,6 +209,28 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "aws-lc-rs" +version = "1.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "base64" version = "0.21.7" @@ -463,6 +485,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + [[package]] name = "collector" version = "0.1.0" @@ -490,7 +521,7 @@ dependencies = [ "ratatui", "rayon", "regex", - "reqwest 0.11.27", + "reqwest 0.13.3", "rustc-demangle", "semver", "serde", @@ -514,6 +545,16 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "compact_str" version = "0.9.0" @@ -565,6 +606,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -749,7 +800,7 @@ dependencies = [ "log", "native-tls", "postgres-native-tls", - "reqwest 0.11.27", + "reqwest 0.13.3", "rusqlite", "serde", "tokio", @@ -766,7 +817,7 @@ checksum = "8907b810935b1fc70e90f415d88e5e3fb1fc0d17058c7da49d5e294eab89decf" dependencies = [ "measureme 10.1.3", "memchr", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", ] @@ -779,7 +830,7 @@ checksum = "ecd00d8cf813abee38134c06d9164d1b82f75158c0dbfdb1fde429dee1e2ce9d" dependencies = [ "measureme 12.0.3", "memchr", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", ] @@ -897,6 +948,12 @@ dependencies = [ "litrs", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" version = "1.8.1" @@ -1093,6 +1150,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" version = "0.3.31" @@ -1199,8 +1262,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1210,9 +1275,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -1239,25 +1306,6 @@ dependencies = [ "walkdir", ] -[[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", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.13" @@ -1269,7 +1317,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.4.0", + "http", "indexmap", "slab", "tokio", @@ -1333,14 +1381,14 @@ dependencies = [ [[package]] name = "headers" -version = "0.3.9" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +checksum = "b3314d5adb5d94bcdf56771f2e50dbbc80bb4bdf88967526706205ac9eff24eb" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "headers-core", - "http 0.2.12", + "http", "httpdate", "mime", "sha1", @@ -1348,11 +1396,11 @@ dependencies = [ [[package]] name = "headers-core" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http 0.2.12", + "http", ] [[package]] @@ -1388,17 +1436,6 @@ dependencies = [ "digest", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.4.0" @@ -1409,17 +1446,6 @@ dependencies = [ "itoa", ] -[[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.1" @@ -1427,7 +1453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.4.0", + "http", ] [[package]] @@ -1438,8 +1464,8 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.4.0", - "http-body 1.0.1", + "http", + "http-body", "pin-project-lite", ] @@ -1470,30 +1496,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.7", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.8.1" @@ -1504,10 +1506,11 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "h2 0.4.13", - "http 1.4.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "httparse", + "httpdate", "itoa", "pin-project-lite", "pin-utils", @@ -1523,27 +1526,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", - "http 1.4.0", - "hyper 1.8.1", + "http", + "hyper", "hyper-util", - "rustls", + "rustls 0.22.4", "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tower-service", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-rustls" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ - "bytes", - "hyper 0.14.32", - "native-tls", + "http", + "hyper", + "hyper-util", + "rustls 0.23.40", "tokio", - "tokio-native-tls", + "tokio-rustls 0.26.4", + "tower-service", ] [[package]] @@ -1552,18 +1557,23 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ + "base64 0.22.1", "bytes", "futures-channel", "futures-util", - "http 1.4.0", - "http-body 1.0.1", - "hyper 1.8.1", + "http", + "http-body", + "hyper", + "ipnet", "libc", + "percent-encoding", "pin-project-lite", "socket2 0.6.2", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] @@ -1891,6 +1901,55 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror 2.0.17", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.104", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.104", +] + [[package]] name = "jobserver" version = "0.1.33" @@ -2035,6 +2094,12 @@ dependencies = [ "hashbrown 0.16.1", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "lzma-sys" version = "0.1.20" @@ -2076,7 +2141,7 @@ dependencies = [ "memmap2", "parking_lot", "perf-event-open-sys 3.0.0", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", ] @@ -2090,7 +2155,7 @@ dependencies = [ "memmap2", "parking_lot", "perf-event-open-sys 3.0.0", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", ] @@ -2176,10 +2241,10 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.5", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.8.2", "security-framework-sys", "tempfile", ] @@ -2275,10 +2340,10 @@ dependencies = [ "chrono", "form_urlencoded", "futures", - "http 1.4.0", + "http", "http-body-util", "humantime", - "hyper 1.8.1", + "hyper", "itertools 0.14.0", "md-5", "parking_lot", @@ -2343,6 +2408,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + [[package]] name = "openssl-sys" version = "0.9.109" @@ -2713,6 +2784,62 @@ dependencies = [ "serde", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.2", + "rustls 0.23.40", + "socket2 0.6.2", + "thiserror 2.0.17", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.2", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash 2.1.2", + "rustls 0.23.40", + "rustls-pki-types", + "slab", + "thiserror 2.0.17", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.2", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" version = "1.0.45" @@ -2943,86 +3070,88 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-tls", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls 0.26.0", + "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 1.0.4", + "rustls 0.22.4", + "rustls-native-certs 0.7.3", + "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 0.1.2", "tokio", - "tokio-native-tls", + "tokio-rustls 0.25.0", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.4" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "62e0021ea2c22aed41653bc7e1419abb2c97e038ff2c33d0e1309e49a97deec0" dependencies = [ "base64 0.22.1", "bytes", + "encoding_rs", + "futures-channel", "futures-core", "futures-util", - "h2 0.4.13", - "http 1.4.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.8.1", - "hyper-rustls", + "hyper", + "hyper-rustls 0.27.9", "hyper-util", - "ipnet", "js-sys", "log", "mime", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-native-certs", - "rustls-pemfile 2.2.0", + "quinn", + "rustls 0.23.40", "rustls-pki-types", + "rustls-platform-verifier", "serde", "serde_json", - "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.2", "tokio", - "tokio-rustls", - "tokio-util", + "tokio-rustls 0.26.4", + "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", "web-sys", - "winreg 0.52.0", ] [[package]] @@ -3141,6 +3270,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + [[package]] name = "rustc_version" version = "0.4.1" @@ -3185,7 +3320,21 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "aws-lc-rs", + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.103.13", "subtle", "zeroize", ] @@ -3196,20 +3345,23 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ - "openssl-probe", - "rustls-pemfile 2.2.0", + "openssl-probe 0.1.5", + "rustls-pemfile", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 2.8.2", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-native-certs" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" dependencies = [ - "base64 0.21.7", + "openssl-probe 0.2.1", + "rustls-pki-types", + "schannel", + "security-framework 3.5.1", ] [[package]] @@ -3227,9 +3379,37 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ + "web-time", "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.40", + "rustls-native-certs 0.8.3", + "rustls-platform-verifier-android", + "rustls-webpki 0.103.13", + "security-framework 3.5.1", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.102.8" @@ -3241,6 +3421,18 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.21" @@ -3293,7 +3485,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.3", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags 2.10.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -3448,6 +3653,22 @@ dependencies = [ "libc", ] +[[package]] +name = "simd_cesu8" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "similar" version = "2.2.1" @@ -3484,9 +3705,11 @@ dependencies = [ "headers", "hex", "hmac", - "http 0.2.12", + "http", + "http-body-util", "humansize", - "hyper 0.14.32", + "hyper", + "hyper-util", "inferno", "insta", "itertools 0.10.5", @@ -3498,7 +3721,7 @@ dependencies = [ "parking_lot", "prometheus", "regex", - "reqwest 0.11.27", + "reqwest 0.13.3", "rmp-serde", "rust-embed", "rust_team_data", @@ -3661,6 +3884,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -3674,20 +3906,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags 1.3.2", - "core-foundation", + "bitflags 2.10.0", + "core-foundation 0.9.3", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -4030,11 +4262,21 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls 0.23.40", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.7" @@ -4083,6 +4325,45 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51" +dependencies = [ + "bitflags 2.10.0", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -4439,6 +4720,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "wezterm-bidi" version = "0.2.3" @@ -4548,6 +4838,35 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -4788,16 +5107,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "winreg" version = "0.52.0" diff --git a/Cargo.toml b/Cargo.toml index 320a5913d..fd008538e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ clap = "4" env_logger = "0.11" hashbrown = "0.17" log = "0.4" -reqwest = "0.11" +reqwest = "0.13" serde = "1" serde_json = "1" tokio = "1.36" diff --git a/site/Cargo.toml b/site/Cargo.toml index 336134367..c41f69907 100644 --- a/site/Cargo.toml +++ b/site/Cargo.toml @@ -20,9 +20,11 @@ serde_json = { workspace = true } tokio = { workspace = true, features = ["macros", "time"] } futures = "0.3" -hyper = { version = "0.14", features = ["server", "stream"] } -headers = "0.3" -http = "0.2" +hyper = { version = "1", features = ["server"] } +hyper-util = { version = "0.1", features = ["tokio", "server-auto"] } +headers = "0.4" +http = "1" +http-body-util = "0.1" rmp-serde = "1.1" brotli = "3.3.3" semver = "1.0" diff --git a/site/src/main.rs b/site/src/main.rs index 1709a49f0..e332f2a30 100644 --- a/site/src/main.rs +++ b/site/src/main.rs @@ -86,10 +86,16 @@ async fn main() { futures::pin_mut!(fut); loop { futures::select! { - _s = server => { - eprintln!("Server completed unexpectedly."); - return; - } + result = server => match result { + Ok(()) => { + eprintln!("Server finished unexpectedly."); + return; + } + Err(e) => { + eprintln!("Server failed: {e:?}"); + return; + } + }, l = fut => { if let Err(e) = l { eprintln!("Loading failed, exiting."); diff --git a/site/src/request_handlers/self_profile.rs b/site/src/request_handlers/self_profile.rs index 09ba2ad14..6e33492bd 100644 --- a/site/src/request_handlers/self_profile.rs +++ b/site/src/request_handlers/self_profile.rs @@ -10,7 +10,8 @@ use database::{metric::Metric, CommitType}; use database::{selector, CodegenBackend, Target}; use database::{ArtifactId, Profile}; use headers::{ContentType, Header}; -use hyper::{Body, StatusCode}; +use hyper::body::Bytes; +use hyper::StatusCode; use std::collections::HashSet; use std::sync::Arc; use std::time::Instant; @@ -19,7 +20,7 @@ pub async fn handle_self_profile_processed_download( body: self_profile_processed::Request, ctxt: &SiteCtxt, allow_compression: bool, -) -> http::Response { +) -> http::Response { log::info!("handle_self_profile_processed_download({:?})", body); let mut params = body.params.clone(); let diff_against = params.remove("base_commit"); @@ -180,7 +181,7 @@ pub async fn handle_self_profile_processed_download( }), ) } else { - builder.body(hyper::Body::from(output.data)).unwrap() + builder.body(Bytes::from(output.data)).unwrap() } } @@ -358,7 +359,7 @@ fn get_self_profile_delta( pub async fn handle_self_profile_raw_download( body: self_profile_raw::Request, ctxt: &SiteCtxt, -) -> http::Response { +) -> http::Response { log::info!("handle_self_profile_raw_download({:?})", body); let id = match get_self_profile_id( @@ -395,7 +396,7 @@ pub async fn handle_self_profile_raw_download( } }; - let mut server_resp = http::Response::new(Body::from(bytes)); + let mut server_resp = http::Response::new(Bytes::from(bytes)); let mut header = vec![]; ContentType::octet_stream().encode(&mut header); server_resp diff --git a/site/src/server.rs b/site/src/server.rs index e54e0b69b..0a1a8df7e 100644 --- a/site/src/server.rs +++ b/site/src/server.rs @@ -9,10 +9,12 @@ use std::str::FromStr; use std::sync::{Arc, LazyLock}; use std::{fmt, str}; -use futures::{future::FutureExt, stream::StreamExt}; use headers::{CacheControl, ContentType, ETag, HeaderMapExt, IfNoneMatch}; use http::header::CACHE_CONTROL; +use http_body_util::{BodyExt, Full, Limited}; +use hyper::body::{Bytes, Incoming}; use hyper::StatusCode; +use hyper_util::rt::TokioIo; use log::{error, info}; use parking_lot::RwLock; use serde::de::DeserializeOwned; @@ -29,15 +31,15 @@ use crate::resources::{Payload, ResourceResolver}; use crate::job_queue::build_queue; -pub type Request = http::Request; -pub type Response = http::Response; +pub type Request = http::Request; +pub type Response = http::Response; macro_rules! check_http_method { ($lhs: expr, $rhs: expr) => { if $lhs != $rhs { return Ok(http::Response::builder() .status(StatusCode::METHOD_NOT_ALLOWED) - .body(hyper::Body::empty()) + .body(Bytes::default()) .unwrap()); } }; @@ -64,7 +66,7 @@ pub fn json_error_response(status: StatusCode, message: impl Into) -> Re let payload = ServerJsonError { error: message.into(), }; - let body = hyper::Body::from(serde_json::to_vec(&payload).unwrap()); + let body = Bytes::from(serde_json::to_vec(&payload).unwrap()); http::Response::builder() .status(status) .header_typed(ContentType::json()) @@ -86,7 +88,7 @@ impl Server { let result = handler(ctxt); Ok(http::Response::builder() .header_typed(ContentType::json()) - .body(hyper::Body::from(serde_json::to_string(&result).unwrap())) + .body(Bytes::from(serde_json::to_string(&result).unwrap())) .unwrap()) } @@ -186,13 +188,13 @@ impl std::error::Error for ServerError {} async fn serve_req(server: Server, req: Request) -> Result { // Don't attempt to get lock if we're updating if server.ctxt.read().is_none() { - return Ok(Response::new(hyper::Body::from("no data yet, please wait"))); + return Ok(Response::new(Bytes::from("no data yet, please wait"))); } if req.method() == http::Method::OPTIONS { return Ok(http::Response::builder() .status(StatusCode::NO_CONTENT) - .body(hyper::Body::empty()) + .body(Bytes::default()) .unwrap()); } let path = req.uri().path().to_owned(); @@ -247,13 +249,13 @@ async fn serve_req(server: Server, req: Request) -> Result Ok(http::Response::builder() .header_typed(ContentType::json()) - .body(hyper::Body::from(serde_json::to_string(&result).unwrap())) + .body(Bytes::from(serde_json::to_string(&result).unwrap())) .unwrap()), Err(err) => Ok(http::Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .header_typed(ContentType::text_utf8()) .header_typed(CacheControl::new().with_no_cache().with_no_store()) - .body(hyper::Body::from(format!("{err:?}"))) + .body(Bytes::from(format!("{err:?}"))) .unwrap()), }; } @@ -319,21 +321,23 @@ async fn serve_req(server: Server, req: Request) -> Result = server.ctxt.read().as_ref().unwrap().clone(); - let mut body = Vec::new(); - while let Some(chunk) = body_stream.next().await { - let chunk = chunk.map_err(|e| ServerError(format!("failed to read chunk: {e:?}")))?; - body.extend_from_slice(&chunk); - // More than 10 MB of data - if body.len() > 1024 * 1024 * 10 { + let body = match Limited::new(body, 1024 * 1024 * 10).collect().await { + Ok(body) => body.to_bytes(), + Err(err) + if err + .downcast_ref::() + .is_some() => + { return Ok(http::Response::builder() .status(StatusCode::PAYLOAD_TOO_LARGE) - .body(hyper::Body::empty()) - .unwrap()); + .body(Bytes::default()) + .unwrap()) } - } + Err(err) => return Err(ServerError(format!("failed to read body: {err}"))), + }; match path { "/perf/get" => Ok(to_response( @@ -344,7 +348,7 @@ async fn serve_req(server: Server, req: Request) -> Result Result { return Ok(http::Response::builder() .status(StatusCode::OK) - .body(hyper::Body::from("missing event header")) + .body(Bytes::from("missing event header")) .unwrap()) } }; @@ -369,7 +373,7 @@ async fn serve_req(server: Server, req: Request) -> Result Ok(http::Response::builder() .status(StatusCode::OK) - .body(hyper::Body::from(format!("unknown event: {event}"))) + .body(Bytes::from(format!("unknown event: {event}"))) .unwrap()), } } @@ -388,20 +392,20 @@ async fn serve_req(server: Server, req: Request) -> Result http::Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .header_typed(ContentType::text_utf8()) .header_typed(CacheControl::new().with_no_cache().with_no_store()) - .body(hyper::Body::from(err)) + .body(Bytes::from(err)) .unwrap(), }, ), _ => Ok(http::Response::builder() .header_typed(ContentType::html()) .status(StatusCode::NOT_FOUND) - .body(hyper::Body::empty()) + .body(Bytes::default()) .unwrap()), } } @@ -422,7 +426,7 @@ where Err(http::Response::builder() .header_typed(ContentType::text_utf8()) .status(StatusCode::BAD_REQUEST) - .body(hyper::Body::from(format!( + .body(Bytes::from(format!( "Failed to deserialize request: {err:?}" ))) .unwrap()) @@ -449,7 +453,7 @@ where Err(err) => Err(http::Response::builder() .header_typed(ContentType::text_utf8()) .status(StatusCode::BAD_REQUEST) - .body(hyper::Body::from(format!( + .body(Bytes::from(format!( "Failed to deserialize request {uri}: {err:?}", ))) .unwrap()), @@ -461,11 +465,7 @@ static TEMPLATES: LazyLock = LazyLock::new(|| ResourceResolver::new().expect("Cannot load resources")); /// Handle the case where the path is to a static file -async fn handle_fs_path( - req: &Request, - path: &str, - use_compression: bool, -) -> Option> { +async fn handle_fs_path(req: &Request, path: &str, use_compression: bool) -> Option { if path.contains("./") | path.contains("../") { return Some(not_found()); } @@ -525,21 +525,21 @@ async fn handle_fs_path( } } - Some(response.body(hyper::Body::from(source)).unwrap()) + Some(response.body(Bytes::from(source)).unwrap()) } -fn not_modified(response: http::response::Builder) -> http::Response { +fn not_modified(response: http::response::Builder) -> Response { response .status(StatusCode::NOT_MODIFIED) - .body(hyper::Body::empty()) + .body(Bytes::default()) .unwrap() } -fn not_found() -> http::Response { +fn not_found() -> Response { http::Response::builder() .header_typed(ContentType::html()) .status(StatusCode::NOT_FOUND) - .body(hyper::Body::empty()) + .body(Bytes::default()) .unwrap() } @@ -587,7 +587,7 @@ where .status(StatusCode::INTERNAL_SERVER_ERROR) .header_typed(ContentType::text_utf8()) .header_typed(CacheControl::new().with_no_cache().with_no_store()) - .body(hyper::Body::from(err)) + .body(Bytes::from(err)) .unwrap(), } } @@ -598,14 +598,14 @@ pub fn maybe_compressed_response( compression: &Option, ) -> Response { match compression { - None => response.body(hyper::Body::from(body)).unwrap(), + None => response.body(Bytes::from(body)).unwrap(), Some(brotli_params) => { let compressed = compress_bytes(&body, brotli_params); let response = response.header( hyper::header::CONTENT_ENCODING, hyper::header::HeaderValue::from_static("br"), ); - response.body(hyper::Body::from(compressed)).unwrap() + response.body(Bytes::from(compressed)).unwrap() } } } @@ -620,51 +620,64 @@ fn to_triage_response(result: ServerResult) -> Response { match result { Ok(result) => { let response = http::Response::builder().header_typed(ContentType::text()); - response.body(hyper::Body::from(result.0)).unwrap() + response.body(Bytes::from(result.0)).unwrap() } Err(err) => http::Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .header_typed(ContentType::text_utf8()) - .body(hyper::Body::from(err)) + .body(Bytes::from(err)) .unwrap(), } } -async fn run_server(ctxt: Arc>>>, addr: SocketAddr) { +async fn run_server( + ctxt: Arc>>>, + addr: SocketAddr, +) -> anyhow::Result<()> { let server = Server::new(ctxt); - let svc = hyper::service::make_service_fn(move |_conn| { - let ctx = server.clone(); - async move { - Ok::<_, hyper::Error>(hyper::service::service_fn(move |req| { - let start = std::time::Instant::now(); - let desc = format!("{} {}", req.method(), req.uri()); - serve_req(ctx.clone(), req) - .inspect(move |r| { - let dur = start.elapsed(); - info!("{}: {:?} {:?}", desc, r.as_ref().map(|r| r.status()), dur) - }) - .map(|mut r| { - if let Ok(r) = &mut r { - r.headers_mut().insert( - hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, - hyper::header::HeaderValue::from_static("*"), - ); - } - r - }) - })) - } - }); - let server = hyper::server::Server::bind(&addr).serve(svc); - if let Err(e) = server.await { - eprintln!("server error: {e:?}"); + let listener = tokio::net::TcpListener::bind(addr).await?; + loop { + let (stream, _) = match listener.accept().await { + Ok(conn) => conn, + Err(e) => { + eprintln!("accept error: {e:?}"); + continue; + } + }; + let server = server.clone(); + tokio::spawn(async move { + let svc = hyper::service::service_fn(move |req: Request| { + let ctx = server.clone(); + async move { + let start = std::time::Instant::now(); + let desc = format!("{} {}", req.method(), req.uri()); + let mut r = serve_req(ctx, req).await; + let dur = start.elapsed(); + info!("{}: {:?} {:?}", desc, r.as_ref().map(|r| r.status()), dur); + if let Ok(r) = &mut r { + r.headers_mut().insert( + hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN, + hyper::header::HeaderValue::from_static("*"), + ); + } + r.map(|r| r.map(Full::new)) + } + }); + if let Err(e) = + hyper_util::server::conn::auto::Builder::new(hyper_util::rt::TokioExecutor::new()) + .serve_connection(TokioIo::new(stream), svc) + .await + { + eprintln!("connection error: {e:?}"); + } + }); } } -pub async fn start(ctxt: Arc>>>, port: u16) { +pub async fn start(ctxt: Arc>>>, port: u16) -> anyhow::Result<()> { let mut server_address: SocketAddr = "0.0.0.0:2346".parse().unwrap(); server_address.set_port(port); - run_server(ctxt, server_address).await; + run_server(ctxt, server_address).await } pub trait ResponseHeaders {