From 9fbe5898873e4f0861b3309aab5404d6c0dec199 Mon Sep 17 00:00:00 2001 From: pinkforest <36498018+pinkforest@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:39:31 +1100 Subject: [PATCH 01/36] Initial bump to 0.23 rustls --- Cargo.lock | 452 ++++++++++++++++++++++------ Cargo.toml | 6 +- src/http_client/async_std_compat.rs | 2 +- src/http_client/client.rs | 34 +-- src/rust_tls.rs | 113 ++++--- src/rust_tls/fake_verifier.rs | 60 ++++ 6 files changed, 485 insertions(+), 182 deletions(-) create mode 100644 src/rust_tls/fake_verifier.rs diff --git a/Cargo.lock b/Cargo.lock index 9fb0114..12ba76f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,17 +163,7 @@ dependencies = [ "futures-lite", "rustix 0.37.27", "signal-hook", - "windows-sys", -] - -[[package]] -name = "async-rustls" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd10f063fb367d26334e10c50c67ea31ac542b8c3402be2251db4cfc5d74ba66" -dependencies = [ - "futures-io", - "rustls", + "windows-sys 0.48.0", ] [[package]] @@ -218,7 +208,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -244,6 +234,32 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "aws-lc-rs" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33e4a55b03f8780ba55041bc7be91a2a8ec8c03517b0379d2d6c96d2c30d95" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ede3d6e360a48436fee127cb81710834407b1ec0c48a001cc29dec9005f73e" +dependencies = [ + "bindgen", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -265,6 +281,29 @@ version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.4.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.55", + "which", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -313,12 +352,41 @@ dependencies = [ "libc", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "concurrent-queue" version = "2.2.0" @@ -363,6 +431,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + [[package]] name = "equivalent" version = "1.0.1" @@ -371,23 +451,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -421,7 +490,6 @@ dependencies = [ "async-lock", "async-native-tls", "async-net", - "async-rustls", "async-std", "async-trait", "bytes", @@ -431,6 +499,7 @@ dependencies = [ "fluvio-wasm-timer", "flv-util", "futures-lite", + "futures-rustls", "futures-timer", "futures-util", "http", @@ -527,6 +596,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.28" @@ -598,7 +673,18 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", +] + +[[package]] +name = "futures-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" +dependencies = [ + "futures-io", + "rustls", + "rustls-pki-types", ] [[package]] @@ -654,6 +740,12 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "gloo-timers" version = "0.2.6" @@ -697,6 +789,15 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.11" @@ -794,7 +895,16 @@ checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", ] [[package]] @@ -827,11 +937,27 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" -version = "0.2.147" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libloading" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.48.5", +] [[package]] name = "linux-raw-sys" @@ -841,9 +967,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -897,6 +1023,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -906,6 +1038,12 @@ dependencies = [ "adler", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "native-tls" version = "0.2.11" @@ -937,6 +1075,16 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -995,7 +1143,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -1063,6 +1211,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -1096,7 +1250,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -1130,7 +1284,7 @@ dependencies = [ "libc", "log", "pin-project-lite", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1148,20 +1302,30 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +dependencies = [ + "proc-macro2", + "syn 2.0.55", +] + [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1260,17 +1424,17 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1279,6 +1443,12 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.0" @@ -1299,50 +1469,62 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys 0.3.8", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "rustix" -version = "0.38.9" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.5", - "windows-sys", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.6" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "8c4d6d8ad9f2492485e13453acbb291dd08f64441b6609c491f1c2cd2c6b4fe1" dependencies = [ + "aws-lc-rs", "log", - "ring", + "once_cell", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" dependencies = [ "base64", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "868e20fada228fefaf6b652e00cc73623d54f8171e7352c18bb281571f2d92da" + [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ + "aws-lc-rs", "ring", + "rustls-pki-types", "untrusted", ] @@ -1358,7 +1540,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1373,16 +1555,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "security-framework" version = "2.9.2" @@ -1435,7 +1607,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -1458,6 +1630,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -1509,14 +1687,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "subtle" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -1531,9 +1715,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -1549,8 +1733,8 @@ dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.9", - "windows-sys", + "rustix 0.38.32", + "windows-sys 0.48.0", ] [[package]] @@ -1570,7 +1754,7 @@ checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -1619,7 +1803,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -1663,7 +1847,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", ] [[package]] @@ -1745,9 +1929,9 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -1820,7 +2004,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", "wasm-bindgen-shared", ] @@ -1854,7 +2038,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.55", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1905,6 +2089,18 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.32", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1933,7 +2129,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", ] [[package]] @@ -1942,13 +2147,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -1957,42 +2177,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -2011,3 +2273,9 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", ] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index e9fdc1c..6816ddb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ tls = ["rust_tls"] rust_tls = [ "net", "rustls-pemfile", - "async-rustls", + "futures-rustls", "pin-project", "futures-util/io", ] @@ -96,14 +96,14 @@ async-native-tls = { version = "0.4.0", optional = true } async-fs = { version = "1.3.0", optional = true } async-io = { version = "1.1.2", optional = true } async-net = { version = "1.6.0", optional = true } -async-rustls = { version = "0.4.1", features = ["dangerous_configuration"], optional = true } +futures-rustls = { version = "0.26.0", features = ["aws-lc-rs"], optional = true } async-std = { version = "1.12.0", default-features = false, optional = true } memmap2 = { version = "0.5", optional = true } native-tls = { version = "0.2.4", optional = true } openssl = { version = "0.10.35", optional = true } openssl-sys = { version = "0.9.65", optional = true, features = ["vendored"]} nix = { version = "0.26.0", optional = true } -rustls-pemfile = { version = "1.0.0", optional = true } +rustls-pemfile = { version = "2.1.1", optional = true } socket2 = { version = "0.5.3", default-features = false, features = ["all"], optional = true } diff --git a/src/http_client/async_std_compat.rs b/src/http_client/async_std_compat.rs index e92c0a1..032e05f 100644 --- a/src/http_client/async_std_compat.rs +++ b/src/http_client/async_std_compat.rs @@ -8,8 +8,8 @@ use std::{ }; use anyhow::{anyhow, Error}; -use async_rustls::rustls::ClientConfig; use async_std::io::{Read, Write}; +use futures_rustls::rustls::ClientConfig; use hyper::{ client::connect::{Connected, Connection}, rt, diff --git a/src/http_client/client.rs b/src/http_client/client.rs index 241c460..f6c2239 100644 --- a/src/http_client/client.rs +++ b/src/http_client/client.rs @@ -1,7 +1,7 @@ use std::{str::FromStr, sync::Arc}; use anyhow::{anyhow, Result}; -use async_rustls::rustls::{OwnedTrustAnchor, RootCertStore}; +use futures_rustls::rustls::{pki_types::TrustAnchor, RootCertStore}; use hyper::{Body, Uri}; use once_cell::sync::Lazy; @@ -22,18 +22,14 @@ pub struct Client { static ROOT_CERT_STORE: Lazy = Lazy::new(|| { let mut store = RootCertStore::empty(); store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) + TrustAnchor::from_subject_spki_name_constraints(ta.subject, ta.spki, ta.name_constraints) })); store }); impl Default for Client { fn default() -> Self { - let tls = async_rustls::rustls::ClientConfig::builder().with_safe_defaults(); + let tls = futures_rustls::rustls::ClientConfig::builder().with_safe_defaults(); #[cfg(not(feature = "__skip-http-client-cert-verification"))] let tls = tls.with_root_certificates(ROOT_CERT_STORE.to_owned()); @@ -88,26 +84,6 @@ impl Client { #[cfg(feature = "__skip-http-client-cert-verification")] mod no_verifier { - use std::time::SystemTime; - - use async_rustls::rustls::{ - client::{ServerCertVerified, ServerCertVerifier}, - Certificate, Error, ServerName, - }; - - pub struct NoCertificateVerification; - - impl ServerCertVerifier for NoCertificateVerification { - fn verify_server_cert( - &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &ServerName, - _scts: &mut dyn Iterator, - _ocsp_response: &[u8], - _now: SystemTime, - ) -> Result { - Ok(ServerCertVerified::assertion()) - } - } + + pub use crate::rust_tls::fake_verifier::NoCertificateVerification; } diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 476b422..2cd1db1 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -1,9 +1,11 @@ +pub(crate) mod fake_verifier; + use crate::net::TcpStream; -pub use async_rustls::client::TlsStream as ClientTlsStream; -pub use async_rustls::server::TlsStream as ServerTlsStream; -pub use async_rustls::TlsAcceptor; -pub use async_rustls::TlsConnector; +pub use futures_rustls::client::TlsStream as ClientTlsStream; +pub use futures_rustls::server::TlsStream as ServerTlsStream; +pub use futures_rustls::TlsAcceptor; +pub use futures_rustls::TlsConnector; pub type DefaultServerTlsStream = ServerTlsStream; pub type DefaultClientTlsStream = ClientTlsStream; @@ -42,38 +44,50 @@ mod cert { use std::io::ErrorKind; use std::path::Path; - use async_rustls::rustls::Certificate; - use async_rustls::rustls::PrivateKey; - use async_rustls::rustls::RootCertStore; + use futures_rustls::rustls::pki_types::CertificateDer; + use futures_rustls::rustls::pki_types::PrivateKeyDer; + use futures_rustls::rustls::RootCertStore; use rustls_pemfile::certs; use rustls_pemfile::rsa_private_keys; - pub fn load_certs>(path: P) -> Result, IoError> { + pub fn load_certs>(path: P) -> Result>, IoError> { load_certs_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_certs_from_reader(rd: &mut dyn BufRead) -> Result, IoError> { + pub fn load_certs_from_reader( + rd: &mut dyn BufRead, + ) -> Result>, IoError> { certs(rd) - .map(|v| v.into_iter().map(Certificate).collect()) + .into_iter() + .collect::>>() + // .map(|v| v.into_iter().map(|a| CertificateDer) + // .collect() + // ) .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert")) } /// Load the passed keys file - pub fn load_keys>(path: P) -> Result, IoError> { + pub fn load_keys>(path: P) -> Result>, IoError> { load_keys_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_keys_from_reader(rd: &mut dyn BufRead) -> Result, IoError> { + pub fn load_keys_from_reader( + rd: &mut dyn BufRead, + ) -> Result>, IoError> { rsa_private_keys(rd) - .map(|v| v.into_iter().map(PrivateKey).collect()) + .map(|v| v.into_iter().map(PrivateKeyDer).collect()) .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid key")) } - pub(crate) fn load_first_key>(path: P) -> Result { + pub(crate) fn load_first_key>( + path: P, + ) -> Result, IoError> { load_first_key_from_reader(&mut BufReader::new(File::open(path)?)) } - pub(crate) fn load_first_key_from_reader(rd: &mut dyn BufRead) -> Result { + pub(crate) fn load_first_key_from_reader( + rd: &mut dyn BufRead, + ) -> Result, IoError> { let mut keys = load_keys_from_reader(rd)?; if keys.is_empty() { @@ -104,8 +118,8 @@ mod connector { use std::io::ErrorKind; - use async_rustls::rustls::ServerName; use async_trait::async_trait; + use futures_rustls::rustls::pki_types::ServerName; use log::debug; use crate::net::{ @@ -217,27 +231,25 @@ mod builder { use std::io::ErrorKind; use std::path::Path; use std::sync::Arc; - use std::time::SystemTime; - - use async_rustls::rustls::client::ServerCertVerified; - use async_rustls::rustls::server::WantsServerCert; - use async_rustls::rustls::Certificate; - use async_rustls::rustls::ClientConfig; - use async_rustls::rustls::PrivateKey; - use async_rustls::rustls::RootCertStore; - use async_rustls::rustls::ServerConfig; - use async_rustls::rustls::ServerName; - use async_rustls::rustls::{client::ServerCertVerifier, ConfigBuilder}; - use async_rustls::rustls::{client::WantsTransparencyPolicyOrClientCert, Error as TlsError}; - use async_rustls::rustls::{server::AllowAnyAuthenticatedClient, WantsVerifier}; - use async_rustls::TlsAcceptor; - use async_rustls::TlsConnector; + + use futures_rustls::rustls::client::WantsClientCert; + use futures_rustls::rustls::pki_types::CertificateDer; + use futures_rustls::rustls::pki_types::PrivateKeyDer; + use futures_rustls::rustls::server::WantsServerCert; + use futures_rustls::rustls::ClientConfig; + use futures_rustls::rustls::ConfigBuilder; + use futures_rustls::rustls::RootCertStore; + use futures_rustls::rustls::ServerConfig; + use futures_rustls::rustls::WantsVerifier; + use futures_rustls::TlsAcceptor; + use futures_rustls::TlsConnector; use super::load_root_ca; use super::{load_certs, load_first_key_from_reader}; use super::{load_certs_from_reader, load_first_key}; pub type ClientConfigBuilder = ConfigBuilder; + pub use crate::rust_tls::fake_verifier::NoCertificateVerification; pub struct ConnectorBuilder; @@ -253,7 +265,7 @@ mod builder { pub fn load_ca_cert>( self, path: P, - ) -> Result, IoError> { + ) -> Result, IoError> { let certs = load_certs(path)?; self.with_root_certificates(&certs) } @@ -261,7 +273,7 @@ mod builder { pub fn load_ca_cert_from_bytes( self, buffer: &[u8], - ) -> Result, IoError> { + ) -> Result, IoError> { let certs = load_certs_from_reader(&mut Cursor::new(buffer))?; self.with_root_certificates(&certs) } @@ -277,8 +289,8 @@ mod builder { fn with_root_certificates( self, - certs: &[Certificate], - ) -> Result, IoError> { + certs: &[CertificateDer], + ) -> Result, IoError> { let mut root_store = RootCertStore::empty(); for cert in certs { @@ -293,7 +305,7 @@ mod builder { } } - impl ConnectorBuilderStage { + impl ConnectorBuilderStage { pub fn load_client_certs>( self, cert_path: P, @@ -320,8 +332,8 @@ mod builder { fn with_single_cert( self, - certs: Vec, - key: PrivateKey, + certs: Vec, + key: PrivateKeyDer, ) -> Result { let config = self .0 @@ -356,6 +368,9 @@ mod builder { AcceptorBuilderStage(self.0.with_no_client_auth()) } + /* TODO: re-plumb this + https://docs.rs/rustls/0.21.6/rustls/server/struct.AllowAnyAuthenticatedClient.html + https://docs.rs/rustls/0.23.3/rustls/struct.ConfigBuilder.html#method.with_client_cert_verifier /// Require client authentication. Must pass CA root path. pub fn client_authenticate>( self, @@ -367,6 +382,7 @@ mod builder { Arc::new(AllowAnyAuthenticatedClient::new(root_store)), ))) } + */ } impl AcceptorBuilderStage { @@ -394,23 +410,6 @@ mod builder { TlsAcceptor::from(Arc::new(self.0)) } } - - struct NoCertificateVerification; - - impl ServerCertVerifier for NoCertificateVerification { - fn verify_server_cert( - &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &ServerName, - _scts: &mut dyn Iterator, - _ocsp_response: &[u8], - _now: SystemTime, - ) -> Result { - log::debug!("ignoring server cert"); - Ok(ServerCertVerified::assertion()) - } - } } #[cfg(test)] @@ -420,13 +419,13 @@ mod test { use std::net::SocketAddr; use std::time; - use async_rustls::TlsAcceptor; - use async_rustls::TlsConnector; use bytes::BufMut; use bytes::Bytes; use bytes::BytesMut; use futures_lite::future::zip; use futures_lite::stream::StreamExt; + use futures_rustls::TlsAcceptor; + use futures_rustls::TlsConnector; use futures_util::sink::SinkExt; use log::debug; use tokio_util::codec::BytesCodec; diff --git a/src/rust_tls/fake_verifier.rs b/src/rust_tls/fake_verifier.rs new file mode 100644 index 0000000..5ad81fe --- /dev/null +++ b/src/rust_tls/fake_verifier.rs @@ -0,0 +1,60 @@ +use futures_rustls::rustls::client::danger::HandshakeSignatureValid; +use futures_rustls::rustls::client::danger::ServerCertVerified; +use futures_rustls::rustls::client::danger::ServerCertVerifier; +use futures_rustls::rustls::pki_types::CertificateDer; +use futures_rustls::rustls::pki_types::ServerName; +use futures_rustls::rustls::pki_types::UnixTime; +use futures_rustls::rustls::DigitallySignedStruct; +use futures_rustls::rustls::Error as TlsError; +use futures_rustls::rustls::SignatureScheme; + +#[derive(Debug)] +pub struct NoCertificateVerification; + +impl ServerCertVerifier for NoCertificateVerification { + fn verify_server_cert( + &self, + _end_entity: &CertificateDer, + _intermediates: &[CertificateDer], + _server_name: &ServerName, + _ocsp_response: &[u8], + _now: UnixTime, + ) -> Result { + log::debug!("ignoring server cert"); + Ok(ServerCertVerified::assertion()) + } + fn verify_tls12_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &DigitallySignedStruct, + ) -> Result { + Ok(HandshakeSignatureValid::assertion()) + } + fn verify_tls13_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &DigitallySignedStruct, + ) -> Result { + Ok(HandshakeSignatureValid::assertion()) + } + fn supported_verify_schemes(&self) -> Vec { + vec![ + SignatureScheme::RSA_PKCS1_SHA1, + SignatureScheme::ECDSA_SHA1_Legacy, + SignatureScheme::RSA_PKCS1_SHA256, + SignatureScheme::ECDSA_NISTP256_SHA256, + SignatureScheme::RSA_PKCS1_SHA384, + SignatureScheme::ECDSA_NISTP384_SHA384, + SignatureScheme::RSA_PKCS1_SHA512, + SignatureScheme::ECDSA_NISTP521_SHA512, + SignatureScheme::RSA_PSS_SHA256, + SignatureScheme::RSA_PSS_SHA384, + SignatureScheme::RSA_PSS_SHA512, + SignatureScheme::ED25519, + SignatureScheme::ED448, + //SignatureScheme::Unknown(u16), + ] + } +} From ef289f710a4476b2d766c206712d924b1472026a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 04:22:25 +0000 Subject: [PATCH 02/36] Bump async-io from 1.13.0 to 2.3.2 Bumps [async-io](https://github.com/smol-rs/async-io) from 1.13.0 to 2.3.2. - [Release notes](https://github.com/smol-rs/async-io/releases) - [Changelog](https://github.com/smol-rs/async-io/blob/master/CHANGELOG.md) - [Commits](https://github.com/smol-rs/async-io/compare/v1.13.0...v2.3.2) --- updated-dependencies: - dependency-name: async-io dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ddf7f9b..263ae15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -455,7 +455,7 @@ version = "0.6.2" dependencies = [ "anyhow", "async-fs", - "async-io 1.13.0", + "async-io 2.3.2", "async-lock 3.3.0", "async-native-tls", "async-net", diff --git a/Cargo.toml b/Cargo.toml index 8991b6d..648ffbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ fluvio-test-derive = { path = "async-test-derive", version = "0.1.1", optional = [target.'cfg(not(target_arch = "wasm32"))'.dependencies] async-native-tls = { version = "0.5.0", optional = true } async-fs = { version = "2.1.2", optional = true } -async-io = { version = "1.1.2", optional = true } +async-io = { version = "2.3.2", optional = true } async-net = { version = "2.0.0", optional = true } async-rustls = { version = "0.4.1", features = ["dangerous_configuration"], optional = true } async-std = { version = "1.12.0", default-features = false, optional = true } From e35e2536bfaef3cc9d93cc1b8b679022c117b89d Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Wed, 8 May 2024 23:27:42 -0500 Subject: [PATCH 03/36] chore: update tracing --- Cargo.lock | 13 +- Cargo.toml | 2 +- async-test-derive/Cargo.lock | 328 +++++++++++++++++++++++++++++------ 3 files changed, 279 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 263ae15..cb91f41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1732,11 +1732,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1744,9 +1743,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -1755,9 +1754,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", diff --git a/Cargo.toml b/Cargo.toml index 648ffbb..3e41c43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,7 +82,7 @@ pin-utils = { version = "0.1.0", optional = true } pin-project = { version = "1.0.8", optional = true } thiserror = "1.0" tokio = { version = "1.37.0", default-features = false, optional = true } -tracing = { version = "0.1" } +tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3", optional = true } serde = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true } diff --git a/async-test-derive/Cargo.lock b/async-test-derive/Cargo.lock index 5dd4ef8..cc81b7b 100644 --- a/async-test-derive/Cargo.lock +++ b/async-test-derive/Cargo.lock @@ -23,8 +23,8 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" dependencies = [ - "concurrent-queue", - "event-listener", + "concurrent-queue 1.2.2", + "event-listener 2.5.2", "futures-core", ] @@ -35,9 +35,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" dependencies = [ "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", + "concurrent-queue 1.2.2", + "fastrand 1.7.0", + "futures-lite 1.12.0", "once_cell", "slab", ] @@ -50,10 +50,10 @@ checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" dependencies = [ "async-channel", "async-executor", - "async-io", - "async-lock", + "async-io 1.7.0", + "async-lock 2.5.0", "blocking", - "futures-lite", + "futures-lite 1.12.0", "num_cpus", "once_cell", ] @@ -64,26 +64,56 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" dependencies = [ - "concurrent-queue", - "futures-lite", + "concurrent-queue 1.2.2", + "futures-lite 1.12.0", "libc", "log", "once_cell", "parking", - "polling", + "polling 2.2.0", "slab", "socket2", "waker-fn", "winapi", ] +[[package]] +name = "async-io" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue 2.5.0", + "futures-io", + "futures-lite 2.0.0", + "parking", + "polling 3.7.0", + "rustix", + "slab", + "tracing", + "windows-sys", +] + [[package]] name = "async-lock" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" dependencies = [ - "event-listener", + "event-listener 2.5.2", +] + +[[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", + "pin-project-lite", ] [[package]] @@ -92,11 +122,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" dependencies = [ - "async-io", + "async-io 1.7.0", "blocking", "cfg-if", - "event-listener", - "futures-lite", + "event-listener 2.5.2", + "futures-lite 1.12.0", "libc", "once_cell", "signal-hook", @@ -111,14 +141,14 @@ checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-channel", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.7.0", + "async-lock 2.5.0", "async-process", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.12.0", "gloo-timers", "kv-log-macro", "log", @@ -165,6 +195,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + [[package]] name = "blocking" version = "1.2.0" @@ -174,8 +210,8 @@ dependencies = [ "async-channel", "async-task", "atomic-waker", - "fastrand", - "futures-lite", + "fastrand 1.7.0", + "futures-lite 1.12.0", "once_cell", ] @@ -213,15 +249,20 @@ dependencies = [ ] [[package]] -name = "crossbeam-utils" -version = "0.8.10" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "cfg-if", - "once_cell", + "crossbeam-utils", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "ctor" version = "0.1.22" @@ -229,7 +270,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote", - "syn", + "syn 1.0.98", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys", ] [[package]] @@ -238,6 +289,27 @@ version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue 2.5.0", + "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 = "fastrand" version = "1.7.0" @@ -247,17 +319,23 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + [[package]] name = "fluvio-future" version = "0.6.2" dependencies = [ "anyhow", - "async-io", + "async-io 2.3.2", "async-std", "cfg-if", "fluvio-test-derive", "fluvio-wasm-timer", - "futures-lite", + "futures-lite 2.0.0", "log", "pin-project", "thiserror", @@ -273,7 +351,7 @@ dependencies = [ "fluvio-future", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "trybuild", ] @@ -336,9 +414,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -346,7 +424,22 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ - "fastrand", + "fastrand 1.7.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1155db57329dca6d018b61e76b1488ce9a2e5e44028cac420a5898f4fcef63" +dependencies = [ + "fastrand 2.1.0", "futures-core", "futures-io", "memchr", @@ -363,7 +456,7 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -423,6 +516,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "instant" version = "0.1.12" @@ -467,9 +566,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -512,7 +617,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -580,14 +685,14 @@ checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -608,20 +713,35 @@ dependencies = [ "winapi", ] +[[package]] +name = "polling" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +dependencies = [ + "cfg-if", + "concurrent-queue 2.5.0", + "hermit-abi 0.3.9", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys", +] + [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -632,7 +752,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -668,6 +788,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "ryu" version = "1.0.10" @@ -709,7 +842,7 @@ checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -784,6 +917,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -810,7 +954,7 @@ checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -833,11 +977,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -845,20 +988,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.61", ] [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -961,7 +1104,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.98", "wasm-bindgen-shared", ] @@ -995,7 +1138,7 @@ checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1056,6 +1199,79 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + [[package]] name = "ws_stream_wasm" version = "0.7.3" From b5a06a1893766566e781b5d747717daf24d7f332 Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Thu, 9 May 2024 10:46:01 -0500 Subject: [PATCH 04/36] chore: fire again sleeper. See: https://github.com/smol-rs/async-io/pull/129 --- src/timer.rs | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/timer.rs b/src/timer.rs index 22b29bb..c4c1f3f 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -14,18 +14,44 @@ mod inner { /// same as `after` but return () to make it compatible as previous pub fn sleep(duration: Duration) -> Sleeper { - Sleeper(after(duration)) + Sleeper::after(duration) + } + + pub enum SleeperFired { + Fired, + NotFired, + // used when timer is based on interval + // or anything that could be fired multiple times + None, } #[pin_project] - pub struct Sleeper(#[pin] Timer); + pub struct Sleeper { + #[pin] + timer: Timer, + fired: SleeperFired, + } + + impl Sleeper { + pub fn after(duration: Duration) -> Self { + Self { + timer: after(duration), + fired: SleeperFired::NotFired, + } + } + } impl Future for Sleeper { type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.project(); - if this.0.poll(cx).is_ready() { + if let SleeperFired::Fired = *this.fired { + Poll::Ready(()) + } else if this.timer.poll(cx).is_ready() { + if let SleeperFired::NotFired = *this.fired { + *this.fired = SleeperFired::Fired; + } Poll::Ready(()) } else { Poll::Pending From a072a8b79b45cf5d856342b16ea4054e24155428 Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Thu, 9 May 2024 10:50:28 -0500 Subject: [PATCH 05/36] chore: config.toml --- .cargo/{config => config.toml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml From 224bf457d384ec0f79848130d0799735694964cf Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Thu, 9 May 2024 12:28:53 -0500 Subject: [PATCH 06/36] Revert "chore: fire again sleeper. See: https://github.com/smol-rs/async-io/pull/129" This reverts commit b5a06a1893766566e781b5d747717daf24d7f332. --- src/timer.rs | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/timer.rs b/src/timer.rs index c4c1f3f..22b29bb 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -14,44 +14,18 @@ mod inner { /// same as `after` but return () to make it compatible as previous pub fn sleep(duration: Duration) -> Sleeper { - Sleeper::after(duration) - } - - pub enum SleeperFired { - Fired, - NotFired, - // used when timer is based on interval - // or anything that could be fired multiple times - None, + Sleeper(after(duration)) } #[pin_project] - pub struct Sleeper { - #[pin] - timer: Timer, - fired: SleeperFired, - } - - impl Sleeper { - pub fn after(duration: Duration) -> Self { - Self { - timer: after(duration), - fired: SleeperFired::NotFired, - } - } - } + pub struct Sleeper(#[pin] Timer); impl Future for Sleeper { type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.project(); - if let SleeperFired::Fired = *this.fired { - Poll::Ready(()) - } else if this.timer.poll(cx).is_ready() { - if let SleeperFired::NotFired = *this.fired { - *this.fired = SleeperFired::Fired; - } + if this.0.poll(cx).is_ready() { Poll::Ready(()) } else { Poll::Pending From 6532a929ddcb3c62e520c78e6a5d56df921c1a71 Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Thu, 9 May 2024 12:35:43 -0500 Subject: [PATCH 07/36] chore: update test --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/timer.rs | 12 +++++++++--- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d004602..f17b459 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes +## Unreleased + +* Timer sleeper only fires once ([#258](https://github.com/infinyon/future-aio/pull/258)) + ## 0.5.0 * Move to `memmap2` because `memmap` is unmaintained. * Enable `rustls` on `windows` diff --git a/Cargo.lock b/Cargo.lock index cb91f41..e27d496 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,7 +451,7 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "fluvio-future" -version = "0.6.2" +version = "0.7.0" dependencies = [ "anyhow", "async-fs", diff --git a/Cargo.toml b/Cargo.toml index 3e41c43..eba96f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-future" -version = "0.6.2" +version = "0.7.0" edition = "2021" authors = ["Fluvio Contributors "] description = "I/O futures for Fluvio project" diff --git a/src/timer.rs b/src/timer.rs index 22b29bb..505fc16 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -77,7 +77,8 @@ mod test { /// test timer loop #[fluvio_future::test] async fn test_sleep() { - let mut sleep_count: u16 = 0; + let mut times_fired: u16 = 0; + let mut times_not_fired: u16 = 0; let time_now = Instant::now(); let mut sleep_ft = sleep(Duration::from_millis(10)); @@ -86,9 +87,13 @@ mod test { select! { _ = &mut sleep_ft => { // fire everytime but won't make cause more delay than initial 10 ms - sleep_count += 1; + times_fired += 1; debug!("timer fired"); } + + _ = sleep(Duration::from_millis(40)) => { + times_not_fired += 1; + } } } @@ -98,6 +103,7 @@ mod test { assert!(elapsed < Duration::from_millis(1000)); // make this generous to handle slow CI assert!(elapsed > Duration::from_millis(10)); - assert_eq!(sleep_count, 10); + assert_eq!(times_fired, 1); + assert_eq!(times_not_fired, 9); } } From ab9d2b0c72d3c84505bcfee104e38fbbd692039d Mon Sep 17 00:00:00 2001 From: Luis Moreno Date: Thu, 9 May 2024 12:51:33 -0500 Subject: [PATCH 08/36] chore: update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f17b459..328f84d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ ## Unreleased * Timer sleeper only fires once ([#258](https://github.com/infinyon/future-aio/pull/258)) +* Bump tokio from 1.33.0 to 1.37.0 +* Bump async-lock from 2.8.0 to 3.3.0 +* Bump async-fs from 1.6.0 to 2.1.2 +* Bump bytes from 1.4.0 to 1.6.0 +* Bump once_cell from 1.18.0 to 1.19.0 +* Bump async-net from 1.7.0 to 2.0.0 +* Bump async-native-tls from 0.4.0 to 0.5.0 +* Bump memmap2 from 0.5.10 to 0.9.3 +* Bump async-io from 1.13.0 to 2.3.2 ## 0.5.0 * Move to `memmap2` because `memmap` is unmaintained. From 17a45f0beda5ece23766ca6f227c42c15bafab0e Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 2 Jul 2024 13:50:13 -0400 Subject: [PATCH 09/36] chore: update deps --- Cargo.lock | 1040 ++++++++++++++++----------- Cargo.toml | 84 +-- .cargo/config => config.toml | 0 src/http_client/async_std_compat.rs | 136 ---- src/http_client/client.rs | 113 --- src/http_client/mod.rs | 28 - src/http_client/request.rs | 99 --- src/lib.rs | 3 - src/rust_tls.rs | 188 +++-- tests/test_http_client.rs | 138 ---- 10 files changed, 790 insertions(+), 1039 deletions(-) rename .cargo/config => config.toml (100%) delete mode 100644 src/http_client/async_std_compat.rs delete mode 100644 src/http_client/client.rs delete mode 100644 src/http_client/mod.rs delete mode 100644 src/http_client/request.rs delete mode 100644 tests/test_http_client.rs diff --git a/Cargo.lock b/Cargo.lock index 1e991e5..6191b1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,18 +19,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-attributes" @@ -53,17 +53,28 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.5.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ - "async-lock 2.8.0", "async-task", "concurrent-queue", - "fastrand 1.9.0", - "futures-lite 1.13.0", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] @@ -73,23 +84,23 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "blocking", - "futures-lite 2.0.0", + "futures-lite 2.3.0", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-executor", - "async-io 1.13.0", - "async-lock 2.8.0", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", - "futures-lite 1.13.0", + "futures-lite 2.3.0", "once_cell", "tokio", ] @@ -110,23 +121,23 @@ dependencies = [ "polling 2.8.0", "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.0.0", + "futures-lite 2.3.0", "parking", - "polling 3.5.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "tracing", @@ -144,11 +155,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "event-listener-strategy", "pin-project-lite", ] @@ -171,37 +182,44 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 2.3.2", + "async-io 2.3.3", "blocking", - "futures-lite 2.0.0", + "futures-lite 2.3.0", ] [[package]] name = "async-process" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ "async-io 1.13.0", "async-lock 2.8.0", - "autocfg", + "async-signal", "blocking", "cfg-if", - "event-listener 2.5.3", + "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.37.27", - "signal-hook", + "rustix 0.38.34", "windows-sys 0.48.0", ] [[package]] -name = "async-rustls" -version = "0.4.1" +name = "async-signal" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd10f063fb367d26334e10c50c67ea31ac542b8c3402be2251db4cfc5d74ba66" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" dependencies = [ + "async-io 2.3.3", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", "futures-io", - "rustls", + "rustix 0.38.34", + "signal-hook-registry", + "slab", + "windows-sys 0.52.0", ] [[package]] @@ -211,7 +229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-attributes", - "async-channel", + "async-channel 1.9.0", "async-global-executor", "async-io 1.13.0", "async-lock 2.8.0", @@ -234,19 +252,19 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] @@ -262,21 +280,48 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "aws-lc-rs" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a47f2fb521b70c11ce7369a6c5fa4bd6af7e5d62ec06303875bafe7c6ba245" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "2927c7af777b460b7ccd95f8b67acd7b4c04ec8896bf0c8e80ba30523cffc057" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -289,9 +334,32 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.3" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.68", + "which", +] [[package]] name = "bitflags" @@ -301,30 +369,28 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blocking" -version = "1.3.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", - "async-lock 2.8.0", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite 1.13.0", - "log", + "futures-io", + "futures-lite 2.3.0", + "piper", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" @@ -334,11 +400,22 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" dependencies = [ + "jobserver", "libc", + "once_cell", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", ] [[package]] @@ -347,11 +424,37 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -368,9 +471,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -378,18 +481,27 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" @@ -399,9 +511,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -415,9 +527,20 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -426,11 +549,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 4.0.3", + "event-listener 5.3.1", "pin-project-lite", ] @@ -445,21 +568,20 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fluvio-future" -version = "0.6.3" +version = "0.7.0" dependencies = [ "anyhow", "async-fs", - "async-io 1.13.0", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "async-native-tls", "async-net", - "async-rustls", "async-std", "async-trait", "bytes", @@ -468,7 +590,8 @@ dependencies = [ "fluvio-test-derive", "fluvio-wasm-timer", "flv-util", - "futures-lite 2.0.0", + "futures-lite 2.3.0", + "futures-rustls", "futures-timer", "futures-util", "http", @@ -488,7 +611,7 @@ dependencies = [ "rustls-pemfile", "serde", "serde_json", - "socket2 0.5.3", + "socket2 0.5.7", "thiserror", "tokio", "tokio-util", @@ -558,18 +681,24 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 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.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -582,9 +711,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -592,15 +721,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -609,9 +738,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -630,53 +759,62 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.0.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1155db57329dca6d018b61e76b1488ce9a2e5e44028cac420a5898f4fcef63" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.0", + "fastrand 2.1.0", "futures-core", "futures-io", - "memchr", "parking", "pin-project-lite", - "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", +] + +[[package]] +name = "futures-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" +dependencies = [ + "futures-io", + "rustls", + "rustls-pki-types", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -692,9 +830,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -703,9 +841,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-timers" @@ -721,15 +865,15 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", "indexmap", "slab", @@ -740,21 +884,36 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "home" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] [[package]] name = "http" -version = "0.2.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -763,55 +922,45 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", "http", - "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "hyper" -version = "0.14.27" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -819,9 +968,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -829,9 +978,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -845,22 +994,40 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -876,15 +1043,31 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libloading" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" +dependencies = [ + "cfg-if", + "windows-targets 0.52.5", +] [[package]] name = "linux-raw-sys" @@ -894,15 +1077,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -910,9 +1093,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ "value-bag", ] @@ -928,44 +1111,46 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] [[package]] -name = "memoffset" -version = "0.7.1" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -979,15 +1164,24 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.3" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abbbc55ad7b13aac85f9401c796dcda1b864e07fcad40ad47792eaa8932ea502" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "cfg-if", + "cfg_aliases", "libc", - "memoffset", - "pin-utils", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", ] [[package]] @@ -1006,15 +1200,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.32.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -1031,7 +1225,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -1048,7 +1242,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] @@ -1059,9 +1253,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.1.6+3.1.4" +version = "300.3.1+3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" dependencies = [ "cc", ] @@ -1087,9 +1281,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1111,16 +1305,22 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "winapi", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pharos" @@ -1134,29 +1334,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1164,11 +1364,22 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" @@ -1188,12 +1399,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.5.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi 0.4.0", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -1215,20 +1427,30 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.68", +] + [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1272,25 +1494,16 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.9.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.7", - "regex-syntax 0.7.5", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1304,13 +1517,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.4", ] [[package]] @@ -1321,44 +1534,36 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", + "spin", + "untrusted", + "windows-sys 0.52.0", ] [[package]] -name = "ring" -version = "0.17.3" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.48.0", -] +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" @@ -1389,57 +1594,69 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.11" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ + "aws-lc-rs", "log", - "ring 0.17.3", + "once_cell", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ "base64", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ - "ring 0.17.3", - "untrusted 0.9.0", + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1454,23 +1671,13 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1479,9 +1686,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -1489,9 +1696,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "send_wrapper" @@ -1501,29 +1708,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -1532,28 +1739,24 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] -name = "signal-hook" -version = "0.3.17" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -1569,15 +1772,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -1585,25 +1788,25 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spin" -version = "0.9.8" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1618,9 +1821,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -1629,42 +1832,41 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.0", - "redox_syscall 0.3.5", + "fastrand 2.1.0", "rustix 0.38.34", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -1672,9 +1874,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -1687,9 +1889,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -1700,20 +1902,20 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -1721,22 +1923,14 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", - "tracing", ] -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1744,20 +1938,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -1765,20 +1959,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -1805,37 +1999,31 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -1844,9 +2032,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1861,9 +2049,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "vcpkg" @@ -1873,9 +2061,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "want" @@ -1894,9 +2082,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1904,24 +2092,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -1931,9 +2119,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1941,28 +2129,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-bindgen-test" -version = "0.3.37" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" +checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1974,19 +2162,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.37" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" +checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", + "syn 2.0.68", ] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -1994,9 +2183,24 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.34", +] [[package]] name = "winapi" @@ -2177,3 +2381,23 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", ] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] diff --git a/Cargo.toml b/Cargo.toml index 256ca83..46c8380 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-future" -version = "0.6.3" +version = "0.7.0" edition = "2021" authors = ["Fluvio Contributors "] description = "I/O futures for Fluvio project" @@ -24,7 +24,7 @@ tls = ["rust_tls"] rust_tls = [ "net", "rustls-pemfile", - "async-rustls", + "futures-rustls", "pin-project", "futures-util/io", ] @@ -68,74 +68,74 @@ __skip-http-client-cert-verification = [] [dependencies] anyhow = { version = "1.0" } -async-trait = { version = "0.1.40", optional = true } -bytes = { version = "1.6.0", optional = true } -cfg-if = { version = "1.0.0", optional = true } -futures-lite = { version = "2.0.0", optional = true } -futures-util = { version = "0.3.5", optional = true } -futures-timer = { version = "3.0.0", optional = true } -http = { version = "0.2.11", optional = true } # same as hyper -hyper = { version = "0.14", default-features = false, features = ["client", "http1", "http2"], optional = true } -log = "0.4.0" -once_cell = { version = "1.19.0", optional = true } +async-trait = { version = "0.1.80", optional = true } +bytes = { version = "1.6", optional = true } +cfg-if = { version = "1.0", optional = true } +futures-lite = { version = "2.3", optional = true } +futures-util = { version = "0.3.30", optional = true } +futures-timer = { version = "3.0", optional = true } +http = { version = "1.1", optional = true } # same as hyper +hyper = { version = "1.4", default-features = false, features = ["client", "http1", "http2"], optional = true } +log = "0.4.22" +once_cell = { version = "1.19", optional = true } pin-utils = { version = "0.1.0", optional = true } -pin-project = { version = "1.0.8", optional = true } +pin-project = { version = "1.1", optional = true } thiserror = "1.0" -tokio = { version = "1.37.0", default-features = false, optional = true } -tracing = { version = "0.1" } -tracing-subscriber = { version = "0.3", optional = true } +tokio = { version = "1.38", default-features = false, optional = true } +tracing = { version = "0.1.40" } +tracing-subscriber = { version = "0.3.18", optional = true } serde = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true } -webpki-roots = { version = "0.25", optional = true } +webpki-roots = { version = "0.26.3", optional = true } fluvio-test-derive = { path = "async-test-derive", version = "0.1.1", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] async-native-tls = { version = "0.5.0", optional = true } -async-fs = { version = "2.1.2", optional = true } -async-io = { version = "1.1.2", optional = true } -async-net = { version = "2.0.0", optional = true } -async-rustls = { version = "0.4.1", features = ["dangerous_configuration"], optional = true } -async-std = { version = "1.12.0", default-features = false, optional = true } -memmap2 = { version = "0.9", optional = true } -native-tls = { version = "0.2.4", optional = true } +async-fs = { version = "2.1", optional = true } +async-io = { version = "2.3", optional = true } +async-net = { version = "2.0", optional = true } +async-std = { version = "1.12", default-features = false, optional = true } +futures-rustls = { version = "0.26.0", optional = true } +memmap2 = { version = "0.9.4", optional = true } +native-tls = { version = "0.2.12", optional = true } openssl = { version = "0.10.64", optional = true } openssl-sys = { version = "0.9.102", optional = true, features = ["vendored"]} -nix = { version = "0.26.0", optional = true } -rustls-pemfile = { version = "1.0.0", optional = true } -socket2 = { version = "0.5.3", default-features = false, features = ["all"], optional = true } +nix = { version = "0.29.0", optional = true } +rustls-pemfile = { version = "2.1", optional = true } +socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] -async-std = { version = "1.12.0", default-features = false, features = ["unstable"], optional = true } -ws_stream_wasm = "0.7.3" +async-std = { version = "1.12", default-features = false, features = ["unstable"], optional = true } +ws_stream_wasm = "0.7.4" fluvio-wasm-timer = "0.2.5" [dev-dependencies] -async-lock = "3.3.0" -async-std = { version = "1.12.0", features = ["attributes"] } -bytes = "1.6.0" -futures-util = { version = "0.3.5", features = ["sink", "io"] } -lazy_static = "1.2.0" -num_cpus = "1.10.1" -serde = { version = "1.0.189", features = ["derive"] } -tokio = { version = "1.37.0", features = ["macros"] } -tokio-util = { version = "0.7.0", features = ["codec", "compat"] } +async-lock = "3.4" +async-std = { version = "1.12", features = ["attributes"] } +bytes = "1.6" +futures-util = { version = "0.3.30", features = ["sink", "io"] } +lazy_static = "1.5" +num_cpus = "1.16" +serde = { version = "1.0", features = ["derive"] } +tokio = { version = "1.38", features = ["macros"] } +tokio-util = { version = "0.7.11", features = ["codec", "compat"] } fluvio-test-derive = { path = "async-test-derive", version = "0.1.0" } fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry", "http-client-json", "__skip-http-client-cert-verification"] } -flv-util = { version = "0.5.0", features = ["fixture"] } +flv-util = { version = "0.5.2", features = ["fixture"] } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] portpicker = "0.1.1" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -tracing-wasm = "0.2.0" -wasm-bindgen-futures = "0.4.24" -wasm-bindgen-test = "0.3.24" +tracing-wasm = "0.2.1" +wasm-bindgen-futures = "0.4.42" +wasm-bindgen-test = "0.3.42" diff --git a/.cargo/config b/config.toml similarity index 100% rename from .cargo/config rename to config.toml diff --git a/src/http_client/async_std_compat.rs b/src/http_client/async_std_compat.rs deleted file mode 100644 index e92c0a1..0000000 --- a/src/http_client/async_std_compat.rs +++ /dev/null @@ -1,136 +0,0 @@ -#![allow(dead_code)] // only for http-client part 1 - -use std::{ - future::Future, - pin::Pin, - sync::Arc, - task::{Context, Poll}, -}; - -use anyhow::{anyhow, Error}; -use async_rustls::rustls::ClientConfig; -use async_std::io::{Read, Write}; -use hyper::{ - client::connect::{Connected, Connection}, - rt, - service::Service, - Uri, -}; - -use crate::{ - net::TcpStream, - rust_tls::{DefaultClientTlsStream, TlsConnector}, -}; - -const DEFAULT_PORT: u16 = 443; - -#[derive(Clone)] -pub struct CompatConnector(Arc); - -impl CompatConnector { - pub fn new(tls_config: ClientConfig) -> Self { - Self(Arc::new(TlsConnector::from(Arc::new(tls_config)))) - } -} - -impl Service for CompatConnector { - type Response = TlsStream; - type Error = Error; - type Future = - Pin> + Send + 'static>>; - - fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, uri: Uri) -> Self::Future { - let connector = self.0.clone(); - - let fut = async move { - let host = uri.host().ok_or_else(|| { - let uri = uri.clone(); - anyhow!("no host defined: {uri}") - })?; - - match uri.scheme_str() { - Some("https") => { - let port = uri.port_u16().unwrap_or(DEFAULT_PORT); - let tcp_stream = TcpStream::connect((host, port)) - .await - .map_err(|err| anyhow!("{err}"))?; - - let host = host - .try_into() - .map_err(|err| anyhow!("invalid DNS: {err}"))?; - let stream = connector.connect(host, tcp_stream).await?; - Ok(TlsStream(stream)) - } - Some(scheme) => Err(anyhow!("unsupported protocol: {scheme}")), - _ => Err(anyhow!("no scheme provided")), - } - }; - - Box::pin(fut) - } -} - -pub struct TlsStream(DefaultClientTlsStream); - -impl Connection for TlsStream { - fn connected(&self) -> Connected { - Connected::new() - } -} - -impl tokio::io::AsyncRead for TlsStream { - fn poll_read( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut tokio::io::ReadBuf<'_>, - ) -> Poll> { - match Pin::new(&mut self.0).poll_read(cx, buf.initialize_unfilled())? { - Poll::Ready(bytes_read) => { - buf.advance(bytes_read); - Poll::Ready(Ok(())) - } - Poll::Pending => Poll::Pending, - } - } -} - -impl tokio::io::AsyncWrite for TlsStream { - fn poll_write( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &[u8], - ) -> Poll> { - Pin::new(&mut self.0).poll_write(cx, buf) - } - - fn poll_flush( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll> { - Pin::new(&mut self.0).poll_flush(cx) - } - - fn poll_shutdown( - mut self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll> { - Pin::new(&mut self.0).poll_close(cx) - } -} - -#[derive(Clone)] -pub struct CompatExecutor; - -impl rt::Executor for CompatExecutor -where - F: Future + Send + 'static, - F::Output: Send, -{ - fn execute(&self, fut: F) { - async_std::task::spawn(fut); - } -} diff --git a/src/http_client/client.rs b/src/http_client/client.rs deleted file mode 100644 index 241c460..0000000 --- a/src/http_client/client.rs +++ /dev/null @@ -1,113 +0,0 @@ -use std::{str::FromStr, sync::Arc}; - -use anyhow::{anyhow, Result}; -use async_rustls::rustls::{OwnedTrustAnchor, RootCertStore}; -use hyper::{Body, Uri}; -use once_cell::sync::Lazy; - -use super::{ - async_std_compat::{self, CompatConnector}, - request::RequestBuilder, - USER_AGENT, -}; - -type HyperClient = Arc>; - -#[derive(Clone)] -pub struct Client { - pub(crate) hyper: HyperClient, -} - -#[cfg_attr(feature = "__skip-http-client-cert-verification", allow(dead_code))] -static ROOT_CERT_STORE: Lazy = Lazy::new(|| { - let mut store = RootCertStore::empty(); - store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); - store -}); - -impl Default for Client { - fn default() -> Self { - let tls = async_rustls::rustls::ClientConfig::builder().with_safe_defaults(); - - #[cfg(not(feature = "__skip-http-client-cert-verification"))] - let tls = tls.with_root_certificates(ROOT_CERT_STORE.to_owned()); - - #[cfg(feature = "__skip-http-client-cert-verification")] - let tls = - tls.with_custom_certificate_verifier(Arc::new(no_verifier::NoCertificateVerification)); - - let tls = tls.with_no_client_auth(); - - let https = async_std_compat::CompatConnector::new(tls); - - let client: hyper::Client<_, hyper::Body> = hyper::Client::builder() - .executor(async_std_compat::CompatExecutor) - .build(https); - - Client { - hyper: Arc::new(client), - } - } -} - -impl Client { - pub fn new() -> Self { - Self::default() - } - - pub fn get(&self, uri: impl AsRef) -> Result { - let uri = Uri::from_str(uri.as_ref())?; - let req = http::request::Builder::new().uri(uri); - Ok(RequestBuilder::new(self.clone(), req)) - } - - pub async fn send>( - &self, - req: http::Request, - ) -> Result, anyhow::Error> { - // convert http::Request into hyper::Request - let (mut parts, body) = req.into_parts(); - let body: hyper::Body = body.into(); - if !parts.headers.contains_key(http::header::USER_AGENT) { - let agent = http::header::HeaderValue::from_static(USER_AGENT); - parts.headers.append(http::header::USER_AGENT, agent); - } - let req = hyper::Request::::from_parts(parts, body); - self.hyper - .request(req) - .await - .map_err(|err| anyhow!("request error: {err:?}")) - } -} - -#[cfg(feature = "__skip-http-client-cert-verification")] -mod no_verifier { - use std::time::SystemTime; - - use async_rustls::rustls::{ - client::{ServerCertVerified, ServerCertVerifier}, - Certificate, Error, ServerName, - }; - - pub struct NoCertificateVerification; - - impl ServerCertVerifier for NoCertificateVerification { - fn verify_server_cert( - &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &ServerName, - _scts: &mut dyn Iterator, - _ocsp_response: &[u8], - _now: SystemTime, - ) -> Result { - Ok(ServerCertVerified::assertion()) - } - } -} diff --git a/src/http_client/mod.rs b/src/http_client/mod.rs deleted file mode 100644 index 3150eb5..0000000 --- a/src/http_client/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -mod async_std_compat; -pub mod client; -mod request; - -use anyhow::Result; -pub use client::Client; -pub use hyper::StatusCode; -pub use request::ResponseExt; - -use hyper::{Body, Response}; - -pub const USER_AGENT: &str = "fluvio-futures-http/0.1"; - -/// for simple get requests -pub async fn get(uri: impl AsRef) -> Result> { - Client::new().get(uri)?.send().await -} - -/// for more complex http requests -/// send via a request struct -/// let req = http::Request::get(&uri) -/// .header("foo", "bar") -/// .body("")?; -/// let resp = http_client::send(&htreq).await.expect(&failmsg); -pub async fn send>(req: http::Request) -> Result> { - let client = Client::new(); - client.send(req).await -} diff --git a/src/http_client/request.rs b/src/http_client/request.rs deleted file mode 100644 index bda9446..0000000 --- a/src/http_client/request.rs +++ /dev/null @@ -1,99 +0,0 @@ -use std::{fmt, future::Future, pin::Pin}; - -use anyhow::{anyhow, Result}; -use futures_util::TryFutureExt; -use http::{request::Builder, HeaderName, HeaderValue}; -use hyper::{body::Bytes, Body, Response}; -use tracing::debug; - -use super::client::Client; -use super::USER_AGENT; - -pub struct RequestBuilder { - client: Client, - req_builder: Builder, -} - -impl RequestBuilder { - pub fn new(client: Client, req_builder: Builder) -> Self { - Self { - client, - req_builder, - } - } - - pub fn header(mut self, key: K, value: V) -> RequestBuilder - where - HeaderName: TryFrom, - >::Error: Into, - HeaderValue: TryFrom, - >::Error: Into, - { - self.req_builder = self.req_builder.header(key, value); - self - } - - pub async fn send(self) -> Result> { - let req = self - .req_builder - .header(http::header::USER_AGENT, USER_AGENT) - .body(hyper::Body::empty()) - .map_err(|err| anyhow!("hyper error: {err:?}"))?; - debug!(req=?req, "Request"); - self.client - .hyper - .request(req) - .map_err(|err| anyhow!("request error: {err:?}")) - .await - } -} - -// TODO: prefer static-dispatch once AFIT got stabilized in Rust v1.75 -type ResponseExtFuture = Pin + Send + 'static>>; - -pub trait ResponseExt { - fn bytes(self) -> ResponseExtFuture>; - - #[cfg(feature = "http-client-json")] - fn json(self) -> ResponseExtFuture> - where - Self: Sized + Send + 'static, - { - let fut = async move { - let bytes = self.bytes().await?; - serde_json::from_slice(&bytes).map_err(|err| anyhow!("serialization error: {err:?}")) - }; - - Box::pin(fut) - } - - fn body_string(self) -> ResponseExtFuture> - where - Self: Sized + Send + 'static, - { - let fut = async move { - let body = self.bytes().await?; - let body_str = std::str::from_utf8(&body)?; - Ok(body_str.to_string()) - }; - - Box::pin(fut) - } -} - -impl ResponseExt for Response -where - T: hyper::body::HttpBody + Send + 'static, - T::Data: Send, - T::Error: fmt::Debug, -{ - fn bytes(self) -> ResponseExtFuture> { - let fut = async move { - hyper::body::to_bytes(self.into_body()) - .map_err(|err| anyhow!("{err:?}")) - .await - }; - - Box::pin(fut) - } -} diff --git a/src/lib.rs b/src/lib.rs index f8e7c96..45a2bee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,9 +48,6 @@ pub use crate::native_tls as tls; #[cfg(not(target_arch = "wasm32"))] pub mod openssl; -#[cfg(all(any(unix, windows), feature = "http-client"))] -pub mod http_client; - #[cfg(feature = "sync")] pub mod sync; diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 476b422..264ea4c 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -1,9 +1,9 @@ use crate::net::TcpStream; -pub use async_rustls::client::TlsStream as ClientTlsStream; -pub use async_rustls::server::TlsStream as ServerTlsStream; -pub use async_rustls::TlsAcceptor; -pub use async_rustls::TlsConnector; +pub use futures_rustls::client::TlsStream as ClientTlsStream; +pub use futures_rustls::server::TlsStream as ServerTlsStream; +pub use futures_rustls::TlsAcceptor; +pub use futures_rustls::TlsConnector; pub type DefaultServerTlsStream = ServerTlsStream; pub type DefaultClientTlsStream = ClientTlsStream; @@ -42,38 +42,49 @@ mod cert { use std::io::ErrorKind; use std::path::Path; - use async_rustls::rustls::Certificate; - use async_rustls::rustls::PrivateKey; - use async_rustls::rustls::RootCertStore; + use futures_rustls::rustls::pki_types::CertificateDer; + use futures_rustls::rustls::pki_types::PrivateKeyDer; + use futures_rustls::rustls::RootCertStore; use rustls_pemfile::certs; use rustls_pemfile::rsa_private_keys; - pub fn load_certs>(path: P) -> Result, IoError> { + pub fn load_certs>(path: P) -> Result>, IoError> { load_certs_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_certs_from_reader(rd: &mut dyn BufRead) -> Result, IoError> { + pub fn load_certs_from_reader( + rd: &mut dyn BufRead, + ) -> Result>, IoError> { certs(rd) - .map(|v| v.into_iter().map(Certificate).collect()) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert")) + .map(|r| r.map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))) + .collect() } /// Load the passed keys file - pub fn load_keys>(path: P) -> Result, IoError> { + pub fn load_keys>(path: P) -> Result>, IoError> { load_keys_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_keys_from_reader(rd: &mut dyn BufRead) -> Result, IoError> { + pub fn load_keys_from_reader( + rd: &mut dyn BufRead, + ) -> Result>, IoError> { rsa_private_keys(rd) - .map(|v| v.into_iter().map(PrivateKey).collect()) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid key")) + .map(|r| { + r.map(|p| p.into()) + .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid key")) + }) + .collect() } - pub(crate) fn load_first_key>(path: P) -> Result { + pub(crate) fn load_first_key>( + path: P, + ) -> Result, IoError> { load_first_key_from_reader(&mut BufReader::new(File::open(path)?)) } - pub(crate) fn load_first_key_from_reader(rd: &mut dyn BufRead) -> Result { + pub(crate) fn load_first_key_from_reader( + rd: &mut dyn BufRead, + ) -> Result, IoError> { let mut keys = load_keys_from_reader(rd)?; if keys.is_empty() { @@ -89,7 +100,7 @@ mod cert { let mut root_store = RootCertStore::empty(); - for cert in &certs { + for cert in certs { root_store .add(cert) .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; @@ -104,8 +115,8 @@ mod connector { use std::io::ErrorKind; - use async_rustls::rustls::ServerName; use async_trait::async_trait; + use futures_rustls::rustls::pki_types::ServerName; use log::debug; use crate::net::{ @@ -135,17 +146,17 @@ mod connector { ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { let tcp_stream = stream(domain).await?; let fd = tcp_stream.as_connection_fd(); + + let server_name = ServerName::try_from(domain).map_err(|err| { + IoError::new( + ErrorKind::InvalidInput, + format!("Invalid Dns Name: {}", err), + ) + })?; + let (write, read) = self .0 - .connect( - ServerName::try_from(domain).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("Invalid Dns Name: {}", err), - ) - })?, - tcp_stream, - ) + .connect(server_name.to_owned(), tcp_stream) .await? .split_connection(); Ok((write, read, fd)) @@ -182,17 +193,17 @@ mod connector { let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); debug!("connect to tls domain: {}", self.domain); + + let server_name = ServerName::try_from(self.domain.as_str()).map_err(|err| { + IoError::new( + ErrorKind::InvalidInput, + format!("Invalid Dns Name: {}", err), + ) + })?; + let (write, read) = self .connector - .connect( - ServerName::try_from(self.domain.as_str()).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("Invalid Dns Name: {}", err), - ) - })?, - tcp_stream, - ) + .connect(server_name.to_owned(), tcp_stream) .await? .split_connection(); Ok((write, read, fd)) @@ -217,21 +228,25 @@ mod builder { use std::io::ErrorKind; use std::path::Path; use std::sync::Arc; - use std::time::SystemTime; - - use async_rustls::rustls::client::ServerCertVerified; - use async_rustls::rustls::server::WantsServerCert; - use async_rustls::rustls::Certificate; - use async_rustls::rustls::ClientConfig; - use async_rustls::rustls::PrivateKey; - use async_rustls::rustls::RootCertStore; - use async_rustls::rustls::ServerConfig; - use async_rustls::rustls::ServerName; - use async_rustls::rustls::{client::ServerCertVerifier, ConfigBuilder}; - use async_rustls::rustls::{client::WantsTransparencyPolicyOrClientCert, Error as TlsError}; - use async_rustls::rustls::{server::AllowAnyAuthenticatedClient, WantsVerifier}; - use async_rustls::TlsAcceptor; - use async_rustls::TlsConnector; + + use futures_rustls::pki_types::UnixTime; + use futures_rustls::rustls::client::danger::HandshakeSignatureValid; + use futures_rustls::rustls::client::danger::ServerCertVerified; + use futures_rustls::rustls::client::danger::ServerCertVerifier; + use futures_rustls::rustls::client::WantsClientCert; + use futures_rustls::rustls::pki_types::CertificateDer; + use futures_rustls::rustls::pki_types::PrivateKeyDer; + use futures_rustls::rustls::pki_types::ServerName; + use futures_rustls::rustls::server::WantsServerCert; + use futures_rustls::rustls::server::WebPkiClientVerifier; + use futures_rustls::rustls::ClientConfig; + use futures_rustls::rustls::ConfigBuilder; + use futures_rustls::rustls::Error as TlsError; + use futures_rustls::rustls::RootCertStore; + use futures_rustls::rustls::ServerConfig; + use futures_rustls::rustls::WantsVerifier; + use futures_rustls::TlsAcceptor; + use futures_rustls::TlsConnector; use super::load_root_ca; use super::{load_certs, load_first_key_from_reader}; @@ -243,7 +258,7 @@ mod builder { impl ConnectorBuilder { pub fn with_safe_defaults() -> ConnectorBuilderStage { - ConnectorBuilderStage(ClientConfig::builder().with_safe_defaults()) + ConnectorBuilderStage(ClientConfig::builder()) } } @@ -253,22 +268,23 @@ mod builder { pub fn load_ca_cert>( self, path: P, - ) -> Result, IoError> { + ) -> Result, IoError> { let certs = load_certs(path)?; - self.with_root_certificates(&certs) + self.with_root_certificates(certs) } pub fn load_ca_cert_from_bytes( self, buffer: &[u8], - ) -> Result, IoError> { + ) -> Result, IoError> { let certs = load_certs_from_reader(&mut Cursor::new(buffer))?; - self.with_root_certificates(&certs) + self.with_root_certificates(certs) } pub fn no_cert_verification(self) -> ConnectorBuilderWithConfig { let config = self .0 + .dangerous() .with_custom_certificate_verifier(Arc::new(NoCertificateVerification)) .with_no_client_auth(); @@ -277,8 +293,8 @@ mod builder { fn with_root_certificates( self, - certs: &[Certificate], - ) -> Result, IoError> { + certs: Vec, + ) -> Result, IoError> { let mut root_store = RootCertStore::empty(); for cert in certs { @@ -293,7 +309,7 @@ mod builder { } } - impl ConnectorBuilderStage { + impl ConnectorBuilderStage { pub fn load_client_certs>( self, cert_path: P, @@ -320,8 +336,8 @@ mod builder { fn with_single_cert( self, - certs: Vec, - key: PrivateKey, + certs: Vec>, + key: PrivateKeyDer<'static>, ) -> Result { let config = self .0 @@ -344,7 +360,7 @@ mod builder { impl AcceptorBuilder { pub fn with_safe_defaults() -> AcceptorBuilderStage { - AcceptorBuilderStage(ServerConfig::builder().with_safe_defaults()) + AcceptorBuilderStage(ServerConfig::builder()) } } @@ -363,9 +379,13 @@ mod builder { ) -> Result, IoError> { let root_store = load_root_ca(path)?; - Ok(AcceptorBuilderStage(self.0.with_client_cert_verifier( - Arc::new(AllowAnyAuthenticatedClient::new(root_store)), - ))) + let client_verifier = WebPkiClientVerifier::builder(root_store.into()) + .build() + .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid verifier"))?; + + Ok(AcceptorBuilderStage( + self.0.with_client_cert_verifier(client_verifier), + )) } } @@ -395,21 +415,45 @@ mod builder { } } + #[derive(Debug)] struct NoCertificateVerification; impl ServerCertVerifier for NoCertificateVerification { fn verify_server_cert( &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], + _end_entity: &CertificateDer, + _intermediates: &[CertificateDer], _server_name: &ServerName, - _scts: &mut dyn Iterator, _ocsp_response: &[u8], - _now: SystemTime, + _now: UnixTime, ) -> Result { log::debug!("ignoring server cert"); Ok(ServerCertVerified::assertion()) } + + fn verify_tls12_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &futures_rustls::rustls::DigitallySignedStruct, + ) -> Result { + log::debug!("ignoring server cert"); + Ok(HandshakeSignatureValid::assertion()) + } + + fn verify_tls13_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &futures_rustls::rustls::DigitallySignedStruct, + ) -> Result { + log::debug!("ignoring server cert"); + Ok(HandshakeSignatureValid::assertion()) + } + + fn supported_verify_schemes(&self) -> Vec { + Vec::new() + } } } @@ -420,13 +464,13 @@ mod test { use std::net::SocketAddr; use std::time; - use async_rustls::TlsAcceptor; - use async_rustls::TlsConnector; use bytes::BufMut; use bytes::Bytes; use bytes::BytesMut; use futures_lite::future::zip; use futures_lite::stream::StreamExt; + use futures_rustls::TlsAcceptor; + use futures_rustls::TlsConnector; use futures_util::sink::SinkExt; use log::debug; use tokio_util::codec::BytesCodec; diff --git a/tests/test_http_client.rs b/tests/test_http_client.rs deleted file mode 100644 index a330c30..0000000 --- a/tests/test_http_client.rs +++ /dev/null @@ -1,138 +0,0 @@ -#[cfg(all(any(unix, windows), feature = "http-client"))] -#[cfg(test)] -mod test_http_client { - use anyhow::{Error, Result}; - - use fluvio_future::http_client::{self, ResponseExt, StatusCode}; - use fluvio_future::test_async; - - static DEF_PORT: &str = "7878"; - static SERVER: &str = "https://127.0.0.1"; - static ENV_TEST_PORT: &str = "TEST_PORT"; - - fn https_server_url() -> Result { - let port = std::env::var(ENV_TEST_PORT).unwrap_or(DEF_PORT.to_string()); - let port: u16 = port.parse()?; - let port = port + 1; // http -> https - Ok(format!("{SERVER}:{port}")) - } - - #[test_async] - async fn simple_test() -> Result<(), Error> { - let server_url = https_server_url()?; - let res = http_client::get(&server_url).await; - - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - let status = res.expect(&failmsg).status(); - assert_eq!(status, StatusCode::OK); - Ok(()) - } - - #[test_async] - async fn get_and_deserialize_to_struct() -> Result<(), Error> { - use std::net::{IpAddr, Ipv4Addr}; - - use serde::Deserialize; - - let server_url = https_server_url()?; - - #[allow(dead_code)] - #[derive(Deserialize, Debug, PartialEq)] - struct Ip { - origin: IpAddr, - } - - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - let json = http_client::get(format!("{server_url}/test-data/http-client/ip.json")) - .await - .expect(&failmsg) - .json::() - .await - .expect("failed to parse IP address"); - - assert_eq!( - json, - Ip { - origin: IpAddr::V4(Ipv4Addr::new(192, 0, 0, 1)) - } - ); - Ok(()) - } - - #[test_async] - async fn get_with_header() -> Result<(), Error> { - let server_url = https_server_url()?; - let uri = format!("{server_url}/test-data/plain.txt"); - let htreq = http_client::Client::new().get(uri)?.header("foo", "bar"); - let resp = htreq.send().await?; - let body = resp.bytes().await?; - let body_str = std::str::from_utf8(&body)?; - assert_eq!("plain", body_str); - Ok(()) - } - - #[test_async] - async fn get_body_string() -> Result<(), Error> { - let server_url = https_server_url()?; - let uri = format!("{server_url}/test-data/plain.txt"); - let htreq = http_client::Client::new().get(uri)?; - let resp = htreq.send().await?; - let body = resp.body_string().await?; - assert_eq!("plain", &body); - Ok(()) - } - - #[test_async] - async fn send_get() -> Result<(), Error> { - let server_url = https_server_url()?; - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - - let uri = format!("{server_url}/test-data/plain.txt"); - let htreq = http::Request::get(&uri).header("foo", "bar").body("")?; - - let resp = http_client::send(htreq).await.expect(&failmsg); - - let body = resp.bytes().await?; - let body_str = std::str::from_utf8(&body)?; - assert_eq!("plain", body_str); - Ok(()) - } - - #[test_async] - async fn send_put() -> Result<(), Error> { - let server_url = https_server_url()?; - let failmsg = - format!("failed to get http-server, did you install and run it? {server_url}"); - - let put_txt_content = "dataput"; - let uri = format!("{server_url}/test-put/put.txt"); - let htreq = http::Request::put(&uri).body(put_txt_content)?; - - let resp = http_client::send(htreq).await.expect(&failmsg); - // expected output from test server PUT, if it request was formtted - // and sent this ok for now - assert_eq!(resp.status(), http::StatusCode::METHOD_NOT_ALLOWED); - Ok(()) - } - - // ignored tests used for live local dev sanity check - // cargo test live -- --ignored - #[test_async(ignore)] - async fn live_https() -> Result<(), Error> { - let res = http_client::get("https://hub.infinyon.cloud").await; - - assert!(res.is_ok()); - Ok(()) - } - - #[test_async(ignore)] - async fn live_http_not_supported() -> Result<(), Error> { - let res = http_client::get("http://hub.infinyon.cloud").await; - - assert!(res.is_err()); - Ok(()) - } -} From 7beb2e7cea736f087545d01adb119b78c2fd2a3c Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 3 Jul 2024 17:05:57 -0400 Subject: [PATCH 10/36] fs --- .gitignore | 1 + Cargo.lock | 58 ++++++++++++++++++++++++------------------------ Cargo.toml | 4 ++-- src/fs/mmap.rs | 1 + src/zero_copy.rs | 11 +++++++-- 5 files changed, 42 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 87c4f74..6621722 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ target/ .docker-cargo target-docker .vscode/tasks.json +.vscode/settings.json .idea/ diff --git a/Cargo.lock b/Cargo.lock index 6191b1e..31c57a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1066,7 +1066,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1634,9 +1634,9 @@ checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "aws-lc-rs", "ring", @@ -2239,7 +2239,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2259,18 +2259,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2281,9 +2281,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -2293,9 +2293,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -2305,15 +2305,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -2323,9 +2323,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -2335,9 +2335,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -2347,9 +2347,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -2359,9 +2359,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "ws_stream_wasm" diff --git a/Cargo.toml b/Cargo.toml index 46c8380..4981475 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,8 +101,8 @@ futures-rustls = { version = "0.26.0", optional = true } memmap2 = { version = "0.9.4", optional = true } native-tls = { version = "0.2.12", optional = true } openssl = { version = "0.10.64", optional = true } -openssl-sys = { version = "0.9.102", optional = true, features = ["vendored"]} -nix = { version = "0.29.0", optional = true } +openssl-sys = { version = "0.9.102", optional = true, features = ["vendored"] } +nix = { version = "0.29.0", optional = true, features = ["zerocopy"] } rustls-pemfile = { version = "2.1", optional = true } socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } diff --git a/src/fs/mmap.rs b/src/fs/mmap.rs index 413c441..2466bf8 100644 --- a/src/fs/mmap.rs +++ b/src/fs/mmap.rs @@ -26,6 +26,7 @@ impl MemoryMappedMutFile { .read(true) .write(true) .create(true) + .truncate(false) .open(inner_path) .unwrap(); diff --git a/src/zero_copy.rs b/src/zero_copy.rs index 90ba16a..3e1c565 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -70,9 +70,16 @@ impl ZeroCopy { target_fd ); + let target_ofd = unsafe { + ::from_raw_fd(target_fd) + }; + let source_ofd = unsafe { + ::from_raw_fd(source_fd) + }; + match sendfile( - target_fd, - source_fd, + target_ofd, + source_ofd, Some(&mut current_offset), to_be_transfer, ) { From e4c74ba5f5ac44c0e775746aae9da06b2c7eb548 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 3 Jul 2024 17:34:06 -0400 Subject: [PATCH 11/36] win/mac --- .github/workflows/ci.yml | 2 ++ src/zero_copy.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d770e95..4cf6bd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: with: key: windows-latest-test - uses: cargo-bins/cargo-binstall@main + - uses: ilammy/setup-nasm@v1 - name: Test Setup run: | make certs @@ -29,6 +30,7 @@ jobs: - name: Test run: | Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8" + cargo install --force --locked bindgen-cli cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry,http-client-json,__skip-http-client-cert-verification test: name: Check ${{ matrix.check }} on (${{ matrix.os }}) diff --git a/src/zero_copy.rs b/src/zero_copy.rs index 3e1c565..ea4516d 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -145,6 +145,13 @@ impl ZeroCopy { target_fd ); + let target_ofd = unsafe { + ::from_raw_fd(target_fd) + }; + let source_ofd = unsafe { + ::from_raw_fd(source_fd) + }; + let (res, bytes_transferred) = sendfile( source_fd, target_fd, From e050c7a45cf8fb1792933948bdb975d5fc3f6ce9 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 3 Jul 2024 17:40:33 -0400 Subject: [PATCH 12/36] fmt --- src/zero_copy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zero_copy.rs b/src/zero_copy.rs index ea4516d..98bd3fa 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -151,7 +151,7 @@ impl ZeroCopy { let source_ofd = unsafe { ::from_raw_fd(source_fd) }; - + let (res, bytes_transferred) = sendfile( source_fd, target_fd, From f706e39613b228647f64d466801f5ae100339950 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 5 Jul 2024 12:46:33 -0400 Subject: [PATCH 13/36] fix fd --- async-test-derive/Cargo.lock | 895 ++++++++++++++++++++++++----------- src/zero_copy.rs | 41 +- 2 files changed, 630 insertions(+), 306 deletions(-) diff --git a/async-test-derive/Cargo.lock b/async-test-derive/Cargo.lock index 5dd4ef8..9e54e1a 100644 --- a/async-test-derive/Cargo.lock +++ b/async-test-derive/Cargo.lock @@ -3,104 +3,163 @@ version = 3 [[package]] -name = "ansi_term" -version = "0.12.1" +name = "aho-corasick" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ - "winapi", + "memchr", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "async-channel" -version = "1.6.1" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.4.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ "async-task", "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.2.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5262ed948da60dd8956c6c5aca4d4163593dddb7b32d73267c93dab7b2e98940" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", - "futures-lite", - "num_cpus", + "futures-lite 2.3.0", "once_cell", ] [[package]] name = "async-io" -version = "1.7.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", "concurrent-queue", - "futures-lite", - "libc", + "futures-lite 1.13.0", "log", - "once_cell", "parking", - "polling", + "polling 2.8.0", + "rustix 0.37.27", "slab", "socket2", "waker-fn", - "winapi", +] + +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.7.2", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "async-lock" -version = "2.5.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-process" -version = "1.4.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ - "async-io", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", "blocking", "cfg-if", - "event-listener", - "futures-lite", - "libc", - "once_cell", - "signal-hook", - "winapi", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.34", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-signal" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" +dependencies = [ + "async-io 2.3.3", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.34", + "signal-hook-registry", + "slab", + "windows-sys 0.52.0", ] [[package]] @@ -109,16 +168,16 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "async-process", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -132,9 +191,9 @@ dependencies = [ [[package]] name = "async-task" -version = "4.2.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async_io_stream" @@ -149,15 +208,15 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bitflags" @@ -165,18 +224,23 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + [[package]] name = "blocking" -version = "1.2.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", + "futures-io", + "futures-lite 2.3.0", + "piper", ] [[package]] @@ -185,18 +249,6 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - [[package]] name = "cfg-if" version = "1.0.0" @@ -205,59 +257,93 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "cache-padded", + "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.10" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cfg-if", - "once_cell", + "libc", + "windows-sys 0.52.0", ] [[package]] -name = "ctor" -version = "0.1.22" +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" dependencies = [ - "quote", - "syn", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] name = "event-listener" -version = "2.5.2" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "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.1", + "pin-project-lite", +] [[package]] name = "fastrand" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + [[package]] name = "fluvio-future" -version = "0.6.2" +version = "0.7.0" dependencies = [ "anyhow", - "async-io", + "async-io 2.3.3", "async-std", "cfg-if", "fluvio-test-derive", "fluvio-wasm-timer", - "futures-lite", + "futures-lite 2.3.0", "log", "pin-project", "thiserror", @@ -273,7 +359,7 @@ dependencies = [ "fluvio-future", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "trybuild", ] @@ -294,9 +380,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -309,9 +395,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -319,15 +405,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -336,17 +422,17 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -355,34 +441,47 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.1.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.68", ] [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -398,15 +497,15 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-timers" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" dependencies = [ "futures-channel", "futures-core", @@ -416,18 +515,21 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -435,17 +537,28 @@ dependencies = [ "web-sys", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -461,21 +574,33 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -483,11 +608,10 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ - "cfg-if", "value-bag", ] @@ -497,36 +621,42 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "num_cpus" -version = "1.13.1" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "hermit-abi", - "libc", + "overload", + "winapi", ] [[package]] name = "once_cell" -version = "1.13.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -541,9 +671,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if", "instant", @@ -565,29 +695,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.11" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.68", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -595,53 +725,85 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + [[package]] name = "polling" -version = "2.2.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ + "autocfg", + "bitflags 1.3.2", "cfg-if", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "winapi", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ - "regex-syntax", + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -650,14 +812,31 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", ] [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rustc_version" @@ -668,55 +847,82 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", +] + [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.12" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "send_wrapper" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.138" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.138" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -725,49 +931,42 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] -[[package]] -name = "signal-hook" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "slab" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.9.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -775,9 +974,20 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.98" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -786,58 +996,58 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.68", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -845,20 +1055,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.68", ] [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -866,23 +1076,23 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.14" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a713421342a5a666b7577783721d3117f1b69a393df803ee17bb73b1e122a59" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", @@ -908,9 +1118,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.1" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "valuable" @@ -920,31 +1130,21 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.0.0-alpha.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] - -[[package]] -name = "version_check" -version = "0.9.4" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -952,24 +1152,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.68", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.31" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -979,9 +1179,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -989,42 +1189,33 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "winapi" version = "0.3.9" @@ -1043,11 +1234,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1056,15 +1247,155 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "ws_stream_wasm" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ca1ab42f5afed7fc332b22b6e932ca5414b209465412c8cdf0ad23bc0de645" +checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" dependencies = [ "async_io_stream", "futures", "js-sys", + "log", "pharos", "rustc_version", "send_wrapper", diff --git a/src/zero_copy.rs b/src/zero_copy.rs index 98bd3fa..ad77444 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -1,4 +1,5 @@ use std::io::Error as IoError; +use std::os::fd::BorrowedFd; use std::os::unix::io::{AsRawFd, RawFd}; use std::thread::sleep; use thiserror::Error; @@ -48,8 +49,8 @@ impl ZeroCopy { impl ZeroCopy { pub async fn copy_slice(&self, source: &AsyncFileSlice) -> Result { let size = source.len(); - let target_fd = self.0; - let source_fd = source.fd(); + let target_raw_fd = self.0; + let source_raw_fd = source.fd(); #[cfg(target_os = "linux")] let ft = { @@ -59,27 +60,23 @@ impl ZeroCopy { let mut total_transferred: usize = 0; // total bytes transferred so far let mut current_offset = offset; + let target_fd = unsafe { BorrowedFd::borrow_raw(target_raw_fd) }; + let source_fd = unsafe { BorrowedFd::borrow_raw(source_raw_fd) }; + loop { let to_be_transfer = size as usize - total_transferred; trace!( - "trying: zero copy source fd: {} offset: {} len: {}, target: fd{}", - source_fd, + "trying: zero copy source fd: {} offset: {} len: {}, target fd: {}", + source_raw_fd, current_offset, to_be_transfer, - target_fd + target_raw_fd ); - let target_ofd = unsafe { - ::from_raw_fd(target_fd) - }; - let source_ofd = unsafe { - ::from_raw_fd(source_fd) - }; - match sendfile( - target_ofd, - source_ofd, + &target_fd, + &source_fd, Some(&mut current_offset), to_be_transfer, ) { @@ -111,7 +108,7 @@ impl ZeroCopy { nix::errno::Errno::EAGAIN => { debug!( "EAGAIN, continuing source: {},target: {}", - source_fd, target_fd + source_raw_fd, target_raw_fd ); sleep(std::time::Duration::from_millis(10)); } @@ -134,24 +131,20 @@ impl ZeroCopy { let mut total_transferred = 0; let mut current_offset = offset; + let target_fd = unsafe { BorrowedFd::borrow_raw(target_raw_fd) }; + let source_fd = unsafe { BorrowedFd::borrow_raw(source_raw_fd) }; + loop { let to_be_transfer = (size - total_transferred) as i64; trace!( "mac zero copy source fd: {} offset: {} len: {}, target: fd{}", - source_fd, + source_raw_fd, current_offset, to_be_transfer, - target_fd + target_raw_fd ); - let target_ofd = unsafe { - ::from_raw_fd(target_fd) - }; - let source_ofd = unsafe { - ::from_raw_fd(source_fd) - }; - let (res, bytes_transferred) = sendfile( source_fd, target_fd, From aa932464e02883bc1185b8340430bf5b844a2db8 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 5 Jul 2024 14:14:23 -0400 Subject: [PATCH 14/36] timer --- Cargo.toml | 2 +- src/timer.rs | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4981475..1323f30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ fluvio-test-derive = { path = "async-test-derive", version = "0.1.1", optional = [target.'cfg(not(target_arch = "wasm32"))'.dependencies] async-native-tls = { version = "0.5.0", optional = true } async-fs = { version = "2.1", optional = true } -async-io = { version = "2.3", optional = true } +async-io = { version = "2.3.3", optional = true } async-net = { version = "2.0", optional = true } async-std = { version = "1.12", default-features = false, optional = true } futures-rustls = { version = "0.26.0", optional = true } diff --git a/src/timer.rs b/src/timer.rs index 22b29bb..8bcff5c 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -14,18 +14,31 @@ mod inner { /// same as `after` but return () to make it compatible as previous pub fn sleep(duration: Duration) -> Sleeper { - Sleeper(after(duration)) + Sleeper { + timer: after(duration), + has_fired: false, + } } #[pin_project] - pub struct Sleeper(#[pin] Timer); + pub struct Sleeper { + #[pin] + timer: Timer, + has_fired: bool, + } impl Future for Sleeper { type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.project(); - if this.0.poll(cx).is_ready() { + + if *this.has_fired { + return Poll::Ready(()); + } + + if this.timer.poll(cx).is_ready() { + *this.has_fired = true; Poll::Ready(()) } else { Poll::Pending From 24f169fb758b9e41988a3bb58a8bece5e0e5750d Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 5 Jul 2024 15:02:17 -0400 Subject: [PATCH 15/36] remove http features --- Cargo.lock | 147 ----------------------------------------------------- Cargo.toml | 22 +------- 2 files changed, 1 insertion(+), 168 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31c57a7..9033f70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -503,12 +503,6 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "errno" version = "0.3.9" @@ -594,15 +588,12 @@ dependencies = [ "futures-rustls", "futures-timer", "futures-util", - "http", - "hyper", "lazy_static", "log", "memmap2", "native-tls", "nix", "num_cpus", - "once_cell", "openssl", "openssl-sys", "pin-project", @@ -610,7 +601,6 @@ dependencies = [ "portpicker", "rustls-pemfile", "serde", - "serde_json", "socket2 0.5.7", "thiserror", "tokio", @@ -620,7 +610,6 @@ dependencies = [ "tracing-wasm", "wasm-bindgen-futures", "wasm-bindgen-test", - "webpki-roots", "ws_stream_wasm", ] @@ -658,12 +647,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "foreign-types" version = "0.3.2" @@ -863,31 +846,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "h2" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -909,53 +867,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "hyper" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - [[package]] name = "idna" version = "0.5.0" @@ -966,16 +877,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "instant" version = "0.1.13" @@ -1008,12 +909,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - [[package]] name = "jobserver" version = "0.1.31" @@ -1644,12 +1539,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - [[package]] name = "schannel" version = "0.1.23" @@ -1726,17 +1615,6 @@ dependencies = [ "syn 2.0.68", ] -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "itoa", - "ryu", - "serde", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -1894,7 +1772,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", - "bytes", "num_cpus", "pin-project-lite", "tokio-macros", @@ -1997,12 +1874,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2065,15 +1936,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2181,15 +2043,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "which" version = "4.4.2" diff --git a/Cargo.toml b/Cargo.toml index 1323f30..778a21c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,44 +49,24 @@ zero_copy = ["nix", "task_unstable"] mmap = ["fs", "memmap2", "task_unstable"] retry = [] doomsday = ["task", "sync"] -http-client = [ - "rust_tls", - "async-std/default", - "dep:bytes", - "dep:http", - "dep:hyper", - "dep:serde", - "dep:serde_json", - "dep:tokio", - "dep:once_cell", - "dep:webpki-roots", -] tokio1 = ["async-std/tokio1"] -http-client-json = ["http-client"] # useful for tests __skip-http-client-cert-verification = [] [dependencies] anyhow = { version = "1.0" } async-trait = { version = "0.1.80", optional = true } -bytes = { version = "1.6", optional = true } cfg-if = { version = "1.0", optional = true } futures-lite = { version = "2.3", optional = true } futures-util = { version = "0.3.30", optional = true } futures-timer = { version = "3.0", optional = true } -http = { version = "1.1", optional = true } # same as hyper -hyper = { version = "1.4", default-features = false, features = ["client", "http1", "http2"], optional = true } log = "0.4.22" -once_cell = { version = "1.19", optional = true } pin-utils = { version = "0.1.0", optional = true } pin-project = { version = "1.1", optional = true } thiserror = "1.0" tokio = { version = "1.38", default-features = false, optional = true } tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.18", optional = true } -serde = { version = "1.0", optional = true } -serde_json = { version = "1.0", optional = true } -webpki-roots = { version = "0.26.3", optional = true } fluvio-test-derive = { path = "async-test-derive", version = "0.1.1", optional = true } @@ -126,7 +106,7 @@ tokio = { version = "1.38", features = ["macros"] } tokio-util = { version = "0.7.11", features = ["codec", "compat"] } fluvio-test-derive = { path = "async-test-derive", version = "0.1.0" } -fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry", "http-client-json", "__skip-http-client-cert-verification"] } +fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry"] } flv-util = { version = "0.5.2", features = ["fixture"] } From 36f7b9372926afe5f472b99ee8faab9547185541 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 5 Jul 2024 15:26:46 -0400 Subject: [PATCH 16/36] remove http features --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 -- Makefile | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cf6bd4..da59ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: run: | Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8" cargo install --force --locked bindgen-cli - cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry,http-client-json,__skip-http-client-cert-verification + cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry test: name: Check ${{ matrix.check }} on (${{ matrix.os }}) runs-on: ${{ matrix.os }} diff --git a/Cargo.toml b/Cargo.toml index 778a21c..0042d92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,8 +50,6 @@ mmap = ["fs", "memmap2", "task_unstable"] retry = [] doomsday = ["task", "sync"] tokio1 = ["async-std/tokio1"] -# useful for tests -__skip-http-client-cert-verification = [] [dependencies] anyhow = { version = "1.0" } diff --git a/Makefile b/Makefile index 8416673..187e88b 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ test-macos: PFX_OPTS="" test-macos: certs cert-patch-macos test-derive setup-http-server run-test-macos run-test-macos: TEST_PORT=$$(cat tmp-PORT) cargo test \ - --features "task,subscriber,fixture,task_unstable,io,sync,future,net,tls,timer,fs, zero_copy, retry, doomsday, http-client, tokio1, http-client-json, __skip-http-client-cert-verification" + --features "task,subscriber,fixture,task_unstable,io,sync,future,net,tls,timer,fs,zero_copy,retry,doomsday,tokio1" $(MAKE) teardown-http-server install-wasm-pack: From 9fae865037fbadd148461871c652e860935e453b Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 9 Jul 2024 04:18:16 -0400 Subject: [PATCH 17/36] test attributes --- .gitignore | 1 + Cargo.lock | 2256 ----------------- Cargo.toml | 7 +- async-test-derive/Cargo.lock | 1406 ---------- async-test-derive/LICENSE-APACHE | 201 -- async-test-derive/src/lib.rs | 102 - .../Cargo.toml | 7 +- .../README.md | 0 fluvio-future-derive/src/lib.rs | 76 + .../tests/parse.rs | 0 .../ui-tests/pass_async.rs | 0 .../ui-tests/pass_ignore.rs | 0 src/lib.rs | 9 +- src/retry.rs | 9 +- src/rust_tls.rs | 2 +- src/test_util.rs | 4 +- src/timer.rs | 5 +- src/zero_copy.rs | 7 +- 18 files changed, 105 insertions(+), 3987 deletions(-) delete mode 100644 Cargo.lock delete mode 100644 async-test-derive/Cargo.lock delete mode 100644 async-test-derive/LICENSE-APACHE delete mode 100644 async-test-derive/src/lib.rs rename {async-test-derive => fluvio-future-derive}/Cargo.toml (79%) rename {async-test-derive => fluvio-future-derive}/README.md (100%) create mode 100644 fluvio-future-derive/src/lib.rs rename {async-test-derive => fluvio-future-derive}/tests/parse.rs (100%) rename {async-test-derive => fluvio-future-derive}/ui-tests/pass_async.rs (100%) rename {async-test-derive => fluvio-future-derive}/ui-tests/pass_ignore.rs (100%) diff --git a/.gitignore b/.gitignore index 6621722..9825b5c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ target-docker .vscode/tasks.json .vscode/settings.json .idea/ +Cargo.lock \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 9033f70..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,2256 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-fs" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" -dependencies = [ - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.3", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", - "tokio", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-native-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9343dc5acf07e79ff82d0c37899f079db3534d99f189a1837c8e549c99405bec" -dependencies = [ - "futures-util", - "native-tls", - "thiserror", - "url", -] - -[[package]] -name = "async-net" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" -dependencies = [ - "async-io 2.3.3", - "blocking", - "futures-lite 2.3.0", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.34", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" -dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.34", - "signal-hook-registry", - "slab", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-attributes", - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", -] - -[[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 = "aws-lc-rs" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a47f2fb521b70c11ce7369a6c5fa4bd6af7e5d62ec06303875bafe7c6ba245" -dependencies = [ - "aws-lc-sys", - "mirai-annotations", - "paste", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2927c7af777b460b7ccd95f8b67acd7b4c04ec8896bf0c8e80ba30523cffc057" -dependencies = [ - "bindgen", - "cc", - "cmake", - "dunce", - "fs_extra", - "libc", - "paste", -] - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bindgen" -version = "0.69.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" -dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.68", - "which", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cc" -version = "1.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" -dependencies = [ - "jobserver", - "libc", - "once_cell", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "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.1", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "fluvio-future" -version = "0.7.0" -dependencies = [ - "anyhow", - "async-fs", - "async-io 2.3.3", - "async-lock 3.4.0", - "async-native-tls", - "async-net", - "async-std", - "async-trait", - "bytes", - "cfg-if", - "fluvio-future", - "fluvio-test-derive", - "fluvio-wasm-timer", - "flv-util", - "futures-lite 2.3.0", - "futures-rustls", - "futures-timer", - "futures-util", - "lazy_static", - "log", - "memmap2", - "native-tls", - "nix", - "num_cpus", - "openssl", - "openssl-sys", - "pin-project", - "pin-utils", - "portpicker", - "rustls-pemfile", - "serde", - "socket2 0.5.7", - "thiserror", - "tokio", - "tokio-util", - "tracing", - "tracing-subscriber", - "tracing-wasm", - "wasm-bindgen-futures", - "wasm-bindgen-test", - "ws_stream_wasm", -] - -[[package]] -name = "fluvio-test-derive" -version = "0.1.1" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "fluvio-wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b768c170dc045fa587a8f948c91f9bcfb87f774930477c6215addf54317f137f" -dependencies = [ - "futures", - "js-sys", - "parking_lot", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "flv-util" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de89447c8b4aecfa4c0614d1a7be1c6ab4a0266b59bb2713fd746901f28d124e" -dependencies = [ - "log", - "tracing", -] - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -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.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.1.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "futures-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" -dependencies = [ - "futures-io", - "rustls", - "rustls-pki-types", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "jobserver" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" -dependencies = [ - "cfg-if", - "windows-targets 0.52.6", -] - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "memmap2" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" -dependencies = [ - "libc", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "mirai-annotations" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "object" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-src" -version = "300.3.1+3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" -dependencies = [ - "atomic-waker", - "fastrand 2.1.0", - "futures-io", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "portpicker" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" -dependencies = [ - "rand", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.68", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.23.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" -dependencies = [ - "aws-lc-rs", - "log", - "once_cell", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" -dependencies = [ - "base64", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - -[[package]] -name = "rustls-webpki" -version = "0.102.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" -dependencies = [ - "aws-lc-rs", - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags 2.6.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tinyvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" -dependencies = [ - "backtrace", - "num_cpus", - "pin-project-lite", - "tokio-macros", -] - -[[package]] -name = "tokio-macros" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-io", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "tracing-wasm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" -dependencies = [ - "tracing", - "tracing-subscriber", - "wasm-bindgen", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.68", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasm-bindgen-test" -version = "0.3.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.34", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version", - "send_wrapper", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] diff --git a/Cargo.toml b/Cargo.toml index 0042d92..f2c79e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ all-features = true [features] task = ["async-std/default", "timer", "cfg-if"] subscriber = ["tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter"] -fixture = ["subscriber", "task", "fluvio-test-derive"] +fixture = ["subscriber", "task", "fluvio-future-derive"] task_unstable = ["task", "async-std/unstable"] io = ["async-std/default"] sync = ["async-std/default"] @@ -50,6 +50,7 @@ mmap = ["fs", "memmap2", "task_unstable"] retry = [] doomsday = ["task", "sync"] tokio1 = ["async-std/tokio1"] +attributes = [] [dependencies] anyhow = { version = "1.0" } @@ -66,7 +67,7 @@ tokio = { version = "1.38", default-features = false, optional = true } tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.18", optional = true } -fluvio-test-derive = { path = "async-test-derive", version = "0.1.1", optional = true } +fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] @@ -103,7 +104,7 @@ serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.38", features = ["macros"] } tokio-util = { version = "0.7.11", features = ["codec", "compat"] } -fluvio-test-derive = { path = "async-test-derive", version = "0.1.0" } +fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0" } fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry"] } flv-util = { version = "0.5.2", features = ["fixture"] } diff --git a/async-test-derive/Cargo.lock b/async-test-derive/Cargo.lock deleted file mode 100644 index 9e54e1a..0000000 --- a/async-test-derive/Cargo.lock +++ /dev/null @@ -1,1406 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.3", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.34", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" -dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.34", - "signal-hook-registry", - "slab", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", -] - -[[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 = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "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.1", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "fluvio-future" -version = "0.7.0" -dependencies = [ - "anyhow", - "async-io 2.3.3", - "async-std", - "cfg-if", - "fluvio-test-derive", - "fluvio-wasm-timer", - "futures-lite 2.3.0", - "log", - "pin-project", - "thiserror", - "tracing", - "tracing-subscriber", - "ws_stream_wasm", -] - -[[package]] -name = "fluvio-test-derive" -version = "0.1.1" -dependencies = [ - "fluvio-future", - "proc-macro2", - "quote", - "syn 1.0.109", - "trybuild", -] - -[[package]] -name = "fluvio-wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b768c170dc045fa587a8f948c91f9bcfb87f774930477c6215addf54317f137f" -dependencies = [ - "futures", - "js-sys", - "parking_lot", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.1.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" -dependencies = [ - "atomic-waker", - "fastrand 2.1.0", - "futures-io", -] - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "trybuild" -version = "1.0.42" -source = "git+https://github.com/infinyon/trybuild?branch=check_option#271081028a8b10104c5ab6eb1861e35fd23e156e" -dependencies = [ - "glob", - "lazy_static", - "serde", - "serde_json", - "termcolor", - "toml", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.68", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version", - "send_wrapper", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] diff --git a/async-test-derive/LICENSE-APACHE b/async-test-derive/LICENSE-APACHE deleted file mode 100644 index 261eeb9..0000000 --- a/async-test-derive/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/async-test-derive/src/lib.rs b/async-test-derive/src/lib.rs deleted file mode 100644 index 04d5713..0000000 --- a/async-test-derive/src/lib.rs +++ /dev/null @@ -1,102 +0,0 @@ -extern crate proc_macro; - -use proc_macro::TokenStream; -use proc_macro2::Span; -use quote::quote; -use syn::Ident; -use syn::ItemFn; - -#[proc_macro_attribute] -pub fn test_async(args: TokenStream, item: TokenStream) -> TokenStream { - use syn::AttributeArgs; - - let attribute_args = syn::parse_macro_input!(args as AttributeArgs); - let input = syn::parse_macro_input!(item as ItemFn); - let name = &input.sig.ident; - let sync_name = format!("{}_sync", name); - let out_fn_iden = Ident::new(&sync_name, Span::call_site()); - - let test_attributes = generate::generate_test_attributes(&attribute_args); - - let expression = quote! { - - #[test] - #test_attributes - fn #out_fn_iden() { - - ::fluvio_future::subscriber::init_logger(); - - #input - - let ft = async { - #name().await - }; - - #[cfg(not(target_arch = "wasm32"))] - if let Err(err) = ::fluvio_future::task::run_block_on(ft) { - assert!(false,"error: {:?}",err); - } - #[cfg(target_arch = "wasm32")] - ::fluvio_future::task::run_block_on(ft); - - } - }; - - expression.into() -} - -#[proc_macro_attribute] -pub fn test(args: TokenStream, item: TokenStream) -> TokenStream { - use syn::AttributeArgs; - - let attribute_args = syn::parse_macro_input!(args as AttributeArgs); - let input = syn::parse_macro_input!(item as ItemFn); - let name = &input.sig.ident; - let sync_name = format!("{}_sync", name); - let out_fn_iden = Ident::new(&sync_name, Span::call_site()); - - let test_attributes = generate::generate_test_attributes(&attribute_args); - - let expression = quote! { - - #[test] - #test_attributes - fn #out_fn_iden() { - - ::fluvio_future::subscriber::init_logger(); - - #input - - let ft = async { - #name().await; - }; - - - ::fluvio_future::task::run_block_on(ft); - - } - }; - - expression.into() -} - -mod generate { - - use proc_macro2::TokenStream; - use quote::quote; - use syn::NestedMeta; - - pub fn generate_test_attributes(attributes: &Vec) -> TokenStream { - let args = attributes.iter().map(|meta| { - quote! { - #[#meta] - } - }); - - quote! { - - #(#args)* - - } - } -} diff --git a/async-test-derive/Cargo.toml b/fluvio-future-derive/Cargo.toml similarity index 79% rename from async-test-derive/Cargo.toml rename to fluvio-future-derive/Cargo.toml index cd210e0..829aa56 100644 --- a/async-test-derive/Cargo.toml +++ b/fluvio-future-derive/Cargo.toml @@ -1,12 +1,13 @@ [package] -name = "fluvio-test-derive" -version = "0.1.1" +name = "fluvio-future-derive" +version = "0.1.0" edition = "2018" authors = ["Fluvio Contributors "] description = "Procedure macro to run async fn as test" -repository = "https://github.com/infinyon/flv-future" +repository = "https://github.com/infinyon/future-aio" license = "Apache-2.0" readme = "README.md" +resolver = "2" [lib] proc-macro = true diff --git a/async-test-derive/README.md b/fluvio-future-derive/README.md similarity index 100% rename from async-test-derive/README.md rename to fluvio-future-derive/README.md diff --git a/fluvio-future-derive/src/lib.rs b/fluvio-future-derive/src/lib.rs new file mode 100644 index 0000000..4c6a84f --- /dev/null +++ b/fluvio-future-derive/src/lib.rs @@ -0,0 +1,76 @@ +use proc_macro::TokenStream; +use quote::{quote, quote_spanned}; +use syn::spanned::Spanned; + + +#[proc_macro_attribute] +pub fn main_async(_attr: TokenStream, item: TokenStream) -> TokenStream { + let input = syn::parse_macro_input!(item as syn::ItemFn); + + let ret = &input.sig.output; + let inputs = &input.sig.inputs; + let name = &input.sig.ident; + let body = &input.block; + let attrs = &input.attrs; + let vis = &input.vis; + + if name != "main" { + return TokenStream::from(quote_spanned! { name.span() => + compile_error!("only the main function can be tagged with #[fluvio_future::main_async]"), + }); + } + + if input.sig.asyncness.is_none() { + return TokenStream::from(quote_spanned! { input.span() => + compile_error!("the async keyword is missing from the function declaration"), + }); + } + + let result = quote! { + #vis fn main() #ret { + + ::fluvio_future::subscriber::init_logger(); + + #(#attrs)* + async fn main(#inputs) #ret { + #body + } + + ::fluvio_future::task::run_block_on(async { + main().await + }) + } + + }; + + result.into() +} + +#[proc_macro_attribute] +pub fn test_async(_attr: TokenStream, item: TokenStream) -> TokenStream { + let input = syn::parse_macro_input!(item as syn::ItemFn); + + let ret = &input.sig.output; + let name = &input.sig.ident; + let body = &input.block; + let attrs = &input.attrs; + let vis = &input.vis; + + if input.sig.asyncness.is_none() { + return TokenStream::from(quote_spanned! { input.span() => + compile_error!("the async keyword is missing from the function declaration"), + }); + } + + let result = quote! { + #[::core::prelude::v1::test] + #(#attrs)* + #vis fn #name() #ret { + ::fluvio_future::subscriber::init_logger(); + + ::fluvio_future::task::run_block_on(async { #body }) + } + }; + + result.into() +} diff --git a/async-test-derive/tests/parse.rs b/fluvio-future-derive/tests/parse.rs similarity index 100% rename from async-test-derive/tests/parse.rs rename to fluvio-future-derive/tests/parse.rs diff --git a/async-test-derive/ui-tests/pass_async.rs b/fluvio-future-derive/ui-tests/pass_async.rs similarity index 100% rename from async-test-derive/ui-tests/pass_async.rs rename to fluvio-future-derive/ui-tests/pass_async.rs diff --git a/async-test-derive/ui-tests/pass_ignore.rs b/fluvio-future-derive/ui-tests/pass_ignore.rs similarity index 100% rename from async-test-derive/ui-tests/pass_ignore.rs rename to fluvio-future-derive/ui-tests/pass_ignore.rs diff --git a/src/lib.rs b/src/lib.rs index 45a2bee..176ef1a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,10 +21,7 @@ pub mod retry; mod test_util; #[cfg(any(test, feature = "fixture"))] -pub use fluvio_test_derive::test_async; - -#[cfg(any(test, feature = "fixture"))] -pub use fluvio_test_derive::test; +pub use fluvio_future_derive::test_async; #[cfg(all(unix, feature = "zero_copy"))] pub mod zero_copy; @@ -74,6 +71,10 @@ pub mod subscriber { #[cfg(feature = "doomsday")] pub mod doomsday; +#[cfg(any(feature = "attributes"))] +pub use fluvio_future_derive::main_async; + + /// re-export tracing pub mod tracing { diff --git a/src/retry.rs b/src/retry.rs index f486015..057c502 100644 --- a/src/retry.rs +++ b/src/retry.rs @@ -374,9 +374,10 @@ mod test { use std::io::ErrorKind; use std::ops::AddAssign; use std::time::Duration; + use fluvio_future_derive::test_async; use tracing::debug; - #[fluvio_future::test] + #[test_async] async fn test_fixed_retries_no_delay() { let mut executed_retries = 0u8; let operation = || { @@ -393,7 +394,7 @@ mod test { assert_eq!(executed_retries, 3); } - #[fluvio_future::test] + #[test_async] async fn test_fixed_retries_timeout() { let mut executed_retries = 0u8; let operation = || { @@ -412,7 +413,7 @@ mod test { assert!(executed_retries < 10); } - #[fluvio_future::test] + #[test_async] async fn test_fixed_retries_not_retryable() { let mut executed_retries = 0u8; let operation = || { @@ -430,7 +431,7 @@ mod test { assert_eq!(executed_retries, 1); } - #[fluvio_future::test] + #[test_async] async fn test_conditional_retry() { let mut executed_retries = 0u8; let operation = || { diff --git a/src/rust_tls.rs b/src/rust_tls.rs index cbbc66b..5bd8b8d 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -494,8 +494,8 @@ mod test { use fluvio_future::net::tcp_stream::stream; use fluvio_future::net::TcpListener; - use fluvio_future::test_async; use fluvio_future::timer::sleep; + use fluvio_future::test_async; use super::{AcceptorBuilder, ConnectorBuilder}; diff --git a/src/test_util.rs b/src/test_util.rs index df7a055..dd53cc9 100644 --- a/src/test_util.rs +++ b/src/test_util.rs @@ -42,12 +42,12 @@ mod test { Ok(()) } - #[fluvio_future::test] + #[test_async] async fn simple_test() { assert_eq!(1, "x".len()); } - #[fluvio_future::test(ignore)] + #[test_async(ignore)] async fn simple_test_ignore() { assert_eq!(1, "x".len()); } diff --git a/src/timer.rs b/src/timer.rs index 8bcff5c..2a2b6bc 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -85,10 +85,11 @@ mod test { use log::debug; use tokio::select; - use fluvio_future::timer::sleep; + use crate::timer::sleep; + use crate::test_async; /// test timer loop - #[fluvio_future::test] + #[test_async] async fn test_sleep() { let mut sleep_count: u16 = 0; let time_now = Instant::now(); diff --git a/src/zero_copy.rs b/src/zero_copy.rs index ad77444..25d9888 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -208,11 +208,12 @@ mod tests { use crate::net::TcpListener; use crate::timer::sleep; use crate::{fs::util as file_util, zero_copy::ZeroCopy}; + use crate::test_async; use futures_lite::AsyncReadExt; use super::SendFileError; - #[fluvio_future::test] + #[test_async] async fn test_zero_copy_simple() { let port = portpicker::pick_unused_port().expect("No free ports left"); let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port); @@ -256,7 +257,7 @@ mod tests { let _ = zip(client, server).await; } - #[fluvio_future::test] + #[test_async] async fn test_zero_copy_large_size() { const MAX_BYTES: usize = 3000000; @@ -356,7 +357,7 @@ mod tests { } /// test zero copy when len is too large - #[fluvio_future::test] + #[test_async] async fn test_zero_copy_large_slace() { let port = portpicker::pick_unused_port().expect("No free ports left"); let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port); From 64b9d5f6fc90a9ffa597a80c25892dd23650bf67 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 9 Jul 2024 14:49:18 -0400 Subject: [PATCH 18/36] remove async-std --- .github/workflows/ci.yml | 2 +- Cargo.toml | 14 +++++++------- Makefile | 2 +- fluvio-future-derive/src/lib.rs | 30 +++++++++++++++++++++++++++--- src/doomsday.rs | 11 +++-------- src/fs/extension.rs | 3 +-- src/io.rs | 3 +-- src/lib.rs | 9 ++++----- src/retry.rs | 2 +- src/rust_tls.rs | 25 +++++++------------------ src/task.rs | 26 +++++++++++--------------- src/timer.rs | 2 +- src/zero_copy.rs | 6 +++--- test-data/apirequest.bin | Bin 30 -> 0 bytes test-data/http-client/ip.json | 1 - test-data/plain.txt | 1 - 16 files changed, 68 insertions(+), 69 deletions(-) delete mode 100644 test-data/apirequest.bin delete mode 100644 test-data/http-client/ip.json delete mode 100644 test-data/plain.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da59ff9..8151525 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: run: | Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8" cargo install --force --locked bindgen-cli - cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry + cargo test --features task,subscriber,fixture,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry test: name: Check ${{ matrix.check }} on (${{ matrix.os }}) runs-on: ${{ matrix.os }} diff --git a/Cargo.toml b/Cargo.toml index f2c79e4..042ec3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,11 +12,10 @@ resolver = "2" all-features = true [features] -task = ["async-std/default", "timer", "cfg-if"] +task = ["async-global-executor", "timer", "cfg-if"] subscriber = ["tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter"] fixture = ["subscriber", "task", "fluvio-future-derive"] -task_unstable = ["task", "async-std/unstable"] -io = ["async-std/default"] +io = ["async-io", "async-global-executor/async-io"] sync = ["async-std/default"] future = ["async-std/default"] net = ["futures-lite", "async-net", "async-trait", "cfg-if", "futures-util/io", "socket2"] @@ -28,11 +27,11 @@ rust_tls = [ "pin-project", "futures-util/io", ] -native2_tls = [ +native_tls = [ "net", "pin-project", "async-native-tls", - "native-tls", + "dep:native-tls", "openssl/vendored", "futures-util/io", ] @@ -45,8 +44,8 @@ openssl_tls = [ ] timer = ["async-io", "pin-project", "futures-lite"] fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"] -zero_copy = ["nix", "task_unstable"] -mmap = ["fs", "memmap2", "task_unstable"] +zero_copy = ["nix", "task"] +mmap = ["fs", "memmap2", "task"] retry = [] doomsday = ["task", "sync"] tokio1 = ["async-std/tokio1"] @@ -54,6 +53,7 @@ attributes = [] [dependencies] anyhow = { version = "1.0" } +async-global-executor = { version = "2.4.1", default-features = false, optional = true } async-trait = { version = "0.1.80", optional = true } cfg-if = { version = "1.0", optional = true } futures-lite = { version = "2.3", optional = true } diff --git a/Makefile b/Makefile index 187e88b..d9b19e2 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ test-macos: PFX_OPTS="" test-macos: certs cert-patch-macos test-derive setup-http-server run-test-macos run-test-macos: TEST_PORT=$$(cat tmp-PORT) cargo test \ - --features "task,subscriber,fixture,task_unstable,io,sync,future,net,tls,timer,fs,zero_copy,retry,doomsday,tokio1" + --features "task,subscriber,fixture,io,sync,future,net,tls,timer,fs,zero_copy,retry,doomsday,tokio1" $(MAKE) teardown-http-server install-wasm-pack: diff --git a/fluvio-future-derive/src/lib.rs b/fluvio-future-derive/src/lib.rs index 4c6a84f..492a995 100644 --- a/fluvio-future-derive/src/lib.rs +++ b/fluvio-future-derive/src/lib.rs @@ -1,6 +1,6 @@ use proc_macro::TokenStream; use quote::{quote, quote_spanned}; -use syn::spanned::Spanned; +use syn::{spanned::Spanned, AttributeArgs}; #[proc_macro_attribute] @@ -47,9 +47,11 @@ pub fn main_async(_attr: TokenStream, item: TokenStream) -> TokenStream { } #[proc_macro_attribute] -pub fn test_async(_attr: TokenStream, item: TokenStream) -> TokenStream { - let input = syn::parse_macro_input!(item as syn::ItemFn); +pub fn test_async(args: TokenStream, item: TokenStream) -> TokenStream { + let attribute_args = syn::parse_macro_input!(args as AttributeArgs); + let test_attributes = generate::generate_test_attributes(&attribute_args); + let input = syn::parse_macro_input!(item as syn::ItemFn); let ret = &input.sig.output; let name = &input.sig.ident; let body = &input.block; @@ -64,6 +66,7 @@ pub fn test_async(_attr: TokenStream, item: TokenStream) -> TokenStream { let result = quote! { #[::core::prelude::v1::test] + #test_attributes #(#attrs)* #vis fn #name() #ret { ::fluvio_future::subscriber::init_logger(); @@ -74,3 +77,24 @@ pub fn test_async(_attr: TokenStream, item: TokenStream) -> TokenStream { result.into() } + +mod generate { + + use proc_macro2::TokenStream; + use quote::quote; + use syn::NestedMeta; + + pub fn generate_test_attributes(attributes: &Vec) -> TokenStream { + let args = attributes.iter().map(|meta| { + quote! { + #[#meta] + } + }); + + quote! { + + #(#args)* + + } + } +} \ No newline at end of file diff --git a/src/doomsday.rs b/src/doomsday.rs index 1529ae8..a0cfd49 100644 --- a/src/doomsday.rs +++ b/src/doomsday.rs @@ -10,11 +10,7 @@ use log::info; use tracing::{debug, error}; use crate::sync::Mutex; -#[deprecated( - since = "0.5.1", - note = "please use `fluvio_future::task::JoinHandle` instead" -)] -pub use crate::task::JoinHandle; +use crate::task::Task; #[derive(Clone)] /// DoomsdayTimer will configurably panic or exit if it is not @@ -45,7 +41,7 @@ impl DoomsdayTimer { /// Spawn a new doomsday timer. /// If `exit_on_explode` is true, it will terminate process with `exit(1)` if it explodes. /// Otherwise it will call `panic()`. Note that `awaiting` on the jh will panic if the `DoomsdayTimer` panicked - pub fn spawn(duration: Duration, exit_on_explode: bool) -> (Self, JoinHandle<()>) { + pub fn spawn(duration: Duration, exit_on_explode: bool) -> (Self, Task<()>) { let s = Self { time_to_explode: Arc::new(Mutex::new(Instant::now() + duration)), duration, @@ -117,11 +113,10 @@ mod tests { use std::io::Error; #[test_async(should_panic)] - async fn test_explode() -> Result<(), Error> { + async fn test_explode() { let (_, jh) = DoomsdayTimer::spawn(Duration::from_millis(1), false); crate::timer::sleep(Duration::from_millis(2)).await; jh.await; - Ok(()) } #[test_async] diff --git a/src/fs/extension.rs b/src/fs/extension.rs index a7321c6..ac09541 100644 --- a/src/fs/extension.rs +++ b/src/fs/extension.rs @@ -88,14 +88,13 @@ mod tests { use std::io::SeekFrom; use std::io::Write; - use async_std::io::prelude::SeekExt; - use flv_util::fixture::ensure_clean_file; use super::AsyncFileExtension; use crate::fs::util as file_util; use crate::test_async; use futures_lite::AsyncReadExt; + use futures_lite::AsyncSeekExt; use futures_lite::AsyncWriteExt; // sync seek write and read diff --git a/src/io.rs b/src/io.rs index db385e5..4815f8c 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1,2 +1 @@ -pub use async_std::io::*; -pub use async_std::prelude::*; +pub use async_io::*; diff --git a/src/lib.rs b/src/lib.rs index 176ef1a..705196d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,13 +32,13 @@ pub mod net; #[cfg(all(any(unix, windows), feature = "rust_tls"))] pub mod rust_tls; -#[cfg(all(any(unix, windows), feature = "rust_tls", not(feature = "native2_tls")))] +#[cfg(all(any(unix, windows), feature = "rust_tls", not(feature = "native_tls")))] pub use rust_tls as tls; -#[cfg(all(any(unix, windows), feature = "native2_tls"))] +#[cfg(all(any(unix, windows), feature = "native_tls"))] pub mod native_tls; -#[cfg(all(any(unix, windows), feature = "native2_tls", not(feature = "rust_tls")))] +#[cfg(all(any(unix, windows), feature = "native_tls", not(feature = "rust_tls")))] pub use crate::native_tls as tls; #[cfg(feature = "openssl_tls")] @@ -71,10 +71,9 @@ pub mod subscriber { #[cfg(feature = "doomsday")] pub mod doomsday; -#[cfg(any(feature = "attributes"))] +#[cfg(feature = "attributes")] pub use fluvio_future_derive::main_async; - /// re-export tracing pub mod tracing { diff --git a/src/retry.rs b/src/retry.rs index 057c502..a31974e 100644 --- a/src/retry.rs +++ b/src/retry.rs @@ -371,10 +371,10 @@ mod delay { #[cfg(test)] mod test { use super::*; + use fluvio_future_derive::test_async; use std::io::ErrorKind; use std::ops::AddAssign; use std::time::Duration; - use fluvio_future_derive::test_async; use tracing::debug; #[test_async] diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 5bd8b8d..9ef2b81 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -46,7 +46,7 @@ mod cert { use futures_rustls::rustls::pki_types::PrivateKeyDer; use futures_rustls::rustls::RootCertStore; use rustls_pemfile::certs; - use rustls_pemfile::rsa_private_keys; + use rustls_pemfile::pkcs8_private_keys; pub fn load_certs>(path: P) -> Result>, IoError> { load_certs_from_reader(&mut BufReader::new(File::open(path)?)) @@ -68,7 +68,7 @@ mod cert { pub fn load_keys_from_reader( rd: &mut dyn BufRead, ) -> Result>, IoError> { - rsa_private_keys(rd) + pkcs8_private_keys(rd) .map(|r| { r.map(|p| p.into()) .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid key")) @@ -453,21 +453,10 @@ mod builder { } fn supported_verify_schemes(&self) -> Vec { - vec![ - SignatureScheme::RSA_PKCS1_SHA1, - SignatureScheme::ECDSA_SHA1_Legacy, - SignatureScheme::RSA_PKCS1_SHA256, - SignatureScheme::ECDSA_NISTP256_SHA256, - SignatureScheme::RSA_PKCS1_SHA384, - SignatureScheme::ECDSA_NISTP384_SHA384, - SignatureScheme::RSA_PKCS1_SHA512, - SignatureScheme::ECDSA_NISTP521_SHA512, - SignatureScheme::RSA_PSS_SHA256, - SignatureScheme::RSA_PSS_SHA384, - SignatureScheme::RSA_PSS_SHA512, - SignatureScheme::ED25519, - SignatureScheme::ED448, - ] + let provider = futures_rustls::rustls::crypto::aws_lc_rs::default_provider(); + provider + .signature_verification_algorithms + .supported_schemes() } } } @@ -494,8 +483,8 @@ mod test { use fluvio_future::net::tcp_stream::stream; use fluvio_future::net::TcpListener; - use fluvio_future::timer::sleep; use fluvio_future::test_async; + use fluvio_future::timer::sleep; use super::{AcceptorBuilder, ConnectorBuilder}; diff --git a/src/task.rs b/src/task.rs index 7a2aeed..e5ca8a0 100644 --- a/src/task.rs +++ b/src/task.rs @@ -1,11 +1,8 @@ use std::future::Future; -use async_std::task; - use crate::timer::sleep; -#[cfg(feature = "task_unstable")] -pub use async_std::task::spawn_local; +pub use async_global_executor::spawn_local; /// run future and wait forever /// this is typically used in the server @@ -13,7 +10,7 @@ pub fn run(spawn_closure: F) where F: Future + Send + 'static, { - task::block_on(spawn_closure); + async_global_executor::block_on(spawn_closure); } /// run future and wait forever @@ -24,7 +21,7 @@ where { use std::time::Duration; - task::block_on(async { + async_global_executor::block_on(async { spawn_closure.await; // do infinite loop for now loop { @@ -41,15 +38,14 @@ where cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { - pub use async_std::task::spawn_local as spawn; + pub use async_global_executor::spawn_local as spawn; } else { - pub use async_std::task::spawn; + pub use async_global_executor::spawn; } } -#[cfg(feature = "task_unstable")] #[cfg(not(target_arch = "wasm32"))] -pub use async_std::task::spawn_blocking; +pub use async_global_executor::spawn_blocking; cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { @@ -58,14 +54,14 @@ cfg_if::cfg_if! { F: Future + 'static, T: 'static, { - task::block_on(f) + block_on(f) } } else { - pub use async_std::task::block_on as run_block_on; + pub use async_global_executor::block_on as run_block_on; } } -pub use async_std::task::JoinHandle; +pub use async_global_executor::Task; #[cfg(test)] mod basic_test { @@ -133,8 +129,8 @@ mod basic_test { let core_threads = num_cpus::get().max(1); debug!("num threads: {}", core_threads); - spawn(ft1); - spawn(ft2); + spawn(ft1).detach(); + spawn(ft2).detach(); // wait for all futures complete thread::sleep(time::Duration::from_millis(2000)); diff --git a/src/timer.rs b/src/timer.rs index 2a2b6bc..21abcd9 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -85,8 +85,8 @@ mod test { use log::debug; use tokio::select; - use crate::timer::sleep; use crate::test_async; + use crate::timer::sleep; /// test timer loop #[test_async] diff --git a/src/zero_copy.rs b/src/zero_copy.rs index 25d9888..4f3f71c 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -75,8 +75,8 @@ impl ZeroCopy { ); match sendfile( - &target_fd, - &source_fd, + target_fd, + source_fd, Some(&mut current_offset), to_be_transfer, ) { @@ -206,9 +206,9 @@ mod tests { use crate::fs::AsyncFileExtension; use crate::net::tcp_stream::stream; use crate::net::TcpListener; + use crate::test_async; use crate::timer::sleep; use crate::{fs::util as file_util, zero_copy::ZeroCopy}; - use crate::test_async; use futures_lite::AsyncReadExt; use super::SendFileError; diff --git a/test-data/apirequest.bin b/test-data/apirequest.bin deleted file mode 100644 index dfe2683fba53d9ef31f7c2be033aa9ec176e5247..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30 icmZQzV31-EVqjzd0fFTFyyEq6$Zip diff --git a/test-data/http-client/ip.json b/test-data/http-client/ip.json deleted file mode 100644 index 11301d8..0000000 --- a/test-data/http-client/ip.json +++ /dev/null @@ -1 +0,0 @@ -{"origin": "192.0.0.1"} diff --git a/test-data/plain.txt b/test-data/plain.txt deleted file mode 100644 index f8dc9f2..0000000 --- a/test-data/plain.txt +++ /dev/null @@ -1 +0,0 @@ -plain \ No newline at end of file From 523a27c804d3df36d36b0c74944d2ebc4d5c5b38 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 9 Jul 2024 14:50:56 -0400 Subject: [PATCH 19/36] restore test data --- test-data/apirequest.bin | Bin 0 -> 30 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test-data/apirequest.bin diff --git a/test-data/apirequest.bin b/test-data/apirequest.bin new file mode 100644 index 0000000000000000000000000000000000000000..dfe2683fba53d9ef31f7c2be033aa9ec176e5247 GIT binary patch literal 30 icmZQzV31-EVqjzd0fFTFyyEq6$Zip literal 0 HcmV?d00001 From f8bfb63d6eb40845682d9e7cceeff0f936d8d377 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Tue, 9 Jul 2024 15:46:27 -0400 Subject: [PATCH 20/36] reduce deps --- Cargo.toml | 55 ++++++++++++++++----------------- src/doomsday.rs | 3 +- src/fs/bounded.rs | 4 +-- src/fs/extension.rs | 2 +- src/future.rs | 66 +++++++++++++++++++++++++++++++++++++++- src/lib.rs | 1 + src/native_tls.rs | 4 +-- src/net/mod.rs | 6 ++-- src/net/tcp_stream.rs | 2 +- src/openssl/connector.rs | 2 +- src/openssl/test.rs | 2 +- src/rust_tls.rs | 12 +++++--- src/sync.rs | 2 +- src/task.rs | 2 +- src/test_util.rs | 4 +-- src/timer.rs | 2 +- src/zero_copy.rs | 9 +++--- 17 files changed, 121 insertions(+), 57 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 042ec3e..1e05143 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,12 +13,23 @@ all-features = true [features] task = ["async-global-executor", "timer", "cfg-if"] -subscriber = ["tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter"] +subscriber = [ + "tracing-subscriber", + "tracing-subscriber/std", + "tracing-subscriber/env-filter", +] fixture = ["subscriber", "task", "fluvio-future-derive"] io = ["async-io", "async-global-executor/async-io"] -sync = ["async-std/default"] -future = ["async-std/default"] -net = ["futures-lite", "async-net", "async-trait", "cfg-if", "futures-util/io", "socket2"] +sync = ["async-lock"] +future = ["async-io", "pin-project"] +net = [ + "futures-lite", + "async-net", + "async-trait", + "cfg-if", + "futures-util/io", + "socket2", +] tls = ["rust_tls"] rust_tls = [ "net", @@ -48,55 +59,50 @@ zero_copy = ["nix", "task"] mmap = ["fs", "memmap2", "task"] retry = [] doomsday = ["task", "sync"] -tokio1 = ["async-std/tokio1"] +tokio1 = ["async-global-executor/tokio"] attributes = [] + [dependencies] anyhow = { version = "1.0" } async-global-executor = { version = "2.4.1", default-features = false, optional = true } async-trait = { version = "0.1.80", optional = true } cfg-if = { version = "1.0", optional = true } +fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0", optional = true } futures-lite = { version = "2.3", optional = true } futures-util = { version = "0.3.30", optional = true } -futures-timer = { version = "3.0", optional = true } -log = "0.4.22" -pin-utils = { version = "0.1.0", optional = true } pin-project = { version = "1.1", optional = true } +pin-utils = { version = "0.1.0", optional = true } thiserror = "1.0" tokio = { version = "1.38", default-features = false, optional = true } tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.18", optional = true } -fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0", optional = true } - - [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -async-native-tls = { version = "0.5.0", optional = true } async-fs = { version = "2.1", optional = true } -async-io = { version = "2.3.3", optional = true } +async-io = { version = "2.3", optional = true } +async-lock = { version = "3.4", optional = true } +async-native-tls = { version = "0.5.0", optional = true } async-net = { version = "2.0", optional = true } -async-std = { version = "1.12", default-features = false, optional = true } futures-rustls = { version = "0.26.0", optional = true } memmap2 = { version = "0.9.4", optional = true } native-tls = { version = "0.2.12", optional = true } +nix = { version = "0.29.0", optional = true, features = ["zerocopy"] } openssl = { version = "0.10.64", optional = true } openssl-sys = { version = "0.9.102", optional = true, features = ["vendored"] } -nix = { version = "0.29.0", optional = true, features = ["zerocopy"] } rustls-pemfile = { version = "2.1", optional = true } socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } - [target.'cfg(target_arch = "wasm32")'.dependencies] -async-std = { version = "1.12", default-features = false, features = ["unstable"], optional = true } -ws_stream_wasm = "0.7.4" - fluvio-wasm-timer = "0.2.5" +ws_stream_wasm = "0.7.4" [dev-dependencies] -async-lock = "3.4" -async-std = { version = "1.12", features = ["attributes"] } bytes = "1.6" +fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry"] } +fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0" } +flv-util = { version = "0.5.2", features = ["fixture"] } futures-util = { version = "0.3.30", features = ["sink", "io"] } lazy_static = "1.5" num_cpus = "1.16" @@ -104,11 +110,6 @@ serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.38", features = ["macros"] } tokio-util = { version = "0.7.11", features = ["codec", "compat"] } -fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0" } -fluvio-future = { path = ".", features = ["net", "fixture", "timer", "fs", "retry"] } -flv-util = { version = "0.5.2", features = ["fixture"] } - - [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] portpicker = "0.1.1" @@ -116,5 +117,3 @@ portpicker = "0.1.1" tracing-wasm = "0.2.1" wasm-bindgen-futures = "0.4.42" wasm-bindgen-test = "0.3.42" - - diff --git a/src/doomsday.rs b/src/doomsday.rs index a0cfd49..90a9f93 100644 --- a/src/doomsday.rs +++ b/src/doomsday.rs @@ -6,8 +6,7 @@ use std::{ time::{Duration, Instant}, }; -use log::info; -use tracing::{debug, error}; +use tracing::{debug, error, info}; use crate::sync::Mutex; use crate::task::Task; diff --git a/src/fs/bounded.rs b/src/fs/bounded.rs index c2953fd..409c0a6 100644 --- a/src/fs/bounded.rs +++ b/src/fs/bounded.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use std::fmt; -use log::trace; +use tracing::trace; use pin_utils::unsafe_pinned; use pin_utils::unsafe_unpinned; @@ -190,7 +190,7 @@ mod tests { use std::io::SeekFrom; use std::path::Path; - use log::debug; + use tracing::debug; use crate::test_async; use futures_lite::AsyncReadExt; diff --git a/src/fs/extension.rs b/src/fs/extension.rs index ac09541..bedbfd1 100644 --- a/src/fs/extension.rs +++ b/src/fs/extension.rs @@ -8,7 +8,7 @@ use std::os::unix::io::AsRawFd; use async_trait::async_trait; use futures_lite::AsyncSeekExt; -use log::trace; +use tracing::trace; #[cfg(unix)] use crate::file_slice::AsyncFileSlice; diff --git a/src/future.rs b/src/future.rs index db35741..0c6a148 100644 --- a/src/future.rs +++ b/src/future.rs @@ -1 +1,65 @@ -pub use async_std::future::*; +use std::error::Error; +use std::fmt; +use std::future::Future; +use std::pin::Pin; +use std::task::{Context, Poll}; +use std::time::Duration; + +use async_io::Timer; +use pin_project::pin_project; + +/// Awaits a future or times out after a duration of time. +pub async fn timeout(dur: Duration, f: F) -> Result +where + F: Future, +{ + TimeoutFuture::new(f, dur).await +} + +/// A future that times out after a duration of time. +#[pin_project] +pub struct TimeoutFuture { + #[pin] + future: F, + #[pin] + delay: Timer, +} + +impl TimeoutFuture { + #[allow(dead_code)] + pub(super) fn new(future: F, dur: Duration) -> TimeoutFuture { + TimeoutFuture { + future, + delay: Timer::after(dur), + } + } +} + +impl Future for TimeoutFuture { + type Output = Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let this = self.project(); + match this.future.poll(cx) { + Poll::Ready(v) => Poll::Ready(Ok(v)), + Poll::Pending => match this.delay.poll(cx) { + Poll::Ready(_) => Poll::Ready(Err(TimeoutError { _private: () })), + Poll::Pending => Poll::Pending, + }, + } + } +} + +/// An error returned when a future times out. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct TimeoutError { + _private: (), +} + +impl Error for TimeoutError {} + +impl fmt::Display for TimeoutError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + "future has timed out".fmt(f) + } +} diff --git a/src/lib.rs b/src/lib.rs index 705196d..754bad8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,6 +49,7 @@ pub mod openssl; pub mod sync; #[cfg(feature = "future")] +#[cfg(not(target_arch = "wasm32"))] pub mod future; #[cfg(feature = "subscriber")] diff --git a/src/native_tls.rs b/src/native_tls.rs index f9933e8..4f2772a 100644 --- a/src/native_tls.rs +++ b/src/native_tls.rs @@ -36,7 +36,7 @@ mod connector { use async_native_tls::Error as NativeTlsError; use async_trait::async_trait; - use log::debug; + use tracing::debug; use crate::net::{ tcp_stream::{stream, stream_with_opts, SocketOpts}, @@ -434,10 +434,10 @@ mod test { use futures_lite::future::zip; use futures_lite::stream::StreamExt; use futures_util::sink::SinkExt; - use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; + use tracing::debug; use crate::net::certs::CertBuilder; use crate::net::tcp_stream::stream; diff --git a/src/net/mod.rs b/src/net/mod.rs index 260bb68..e71d0ae 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -93,7 +93,7 @@ pub mod certs { use std::io::Error as IoError; use std::path::Path; - use log::debug; + use tracing::debug; pub trait CertBuilder: Sized { fn new(bytes: Vec) -> Self; @@ -155,7 +155,7 @@ mod unix_connector { use std::io::Error as IoError; use async_trait::async_trait; - use log::debug; + use tracing::debug; use super::tcp_stream::stream; @@ -208,7 +208,7 @@ mod test { use futures_lite::future::zip; use futures_lite::stream::StreamExt; use futures_util::AsyncReadExt; - use log::debug; + use tracing::debug; use crate::net::tcp_stream::stream; use crate::net::TcpListener; diff --git a/src/net/tcp_stream.rs b/src/net/tcp_stream.rs index 4bd71bb..3ba84da 100644 --- a/src/net/tcp_stream.rs +++ b/src/net/tcp_stream.rs @@ -121,10 +121,10 @@ mod tests { use futures_lite::AsyncReadExt; use futures_util::SinkExt; use futures_util::StreamExt; - use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; + use tracing::debug; fn to_bytes(bytes: Vec) -> Bytes { let mut buf = BytesMut::with_capacity(bytes.len()); diff --git a/src/openssl/connector.rs b/src/openssl/connector.rs index 3402a31..0b87a62 100644 --- a/src/openssl/connector.rs +++ b/src/openssl/connector.rs @@ -4,9 +4,9 @@ use std::path::Path; use async_trait::async_trait; use futures_lite::io::{AsyncRead, AsyncWrite}; -use log::debug; use openssl::ssl; use openssl::x509::verify::X509VerifyFlags; +use tracing::debug; use crate::net::{ tcp_stream::{stream, stream_with_opts, SocketOpts}, diff --git a/src/openssl/test.rs b/src/openssl/test.rs index 8293f22..a4232ed 100644 --- a/src/openssl/test.rs +++ b/src/openssl/test.rs @@ -8,10 +8,10 @@ use bytes::BytesMut; use futures_lite::future::zip; use futures_lite::stream::StreamExt; use futures_util::SinkExt; -use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; +use tracing::debug; use crate::net::{tcp_stream::stream, TcpListener}; use crate::test_async; diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 9ef2b81..614b183 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -117,7 +117,7 @@ mod connector { use async_trait::async_trait; use futures_rustls::rustls::pki_types::ServerName; - use log::debug; + use tracing::debug; use crate::net::{ tcp_stream::stream, AsConnectionFd, BoxReadConnection, BoxWriteConnection, ConnectionFd, @@ -249,6 +249,8 @@ mod builder { use futures_rustls::TlsAcceptor; use futures_rustls::TlsConnector; + use tracing::debug; + use super::load_root_ca; use super::{load_certs, load_first_key_from_reader}; use super::{load_certs_from_reader, load_first_key}; @@ -428,7 +430,7 @@ mod builder { _ocsp_response: &[u8], _now: UnixTime, ) -> Result { - log::debug!("ignoring server cert"); + debug!("ignoring server cert"); Ok(ServerCertVerified::assertion()) } @@ -438,7 +440,7 @@ mod builder { _cert: &CertificateDer<'_>, _dss: &futures_rustls::rustls::DigitallySignedStruct, ) -> Result { - log::debug!("ignoring server cert"); + debug!("ignoring server cert"); Ok(HandshakeSignatureValid::assertion()) } @@ -448,7 +450,7 @@ mod builder { _cert: &CertificateDer<'_>, _dss: &futures_rustls::rustls::DigitallySignedStruct, ) -> Result { - log::debug!("ignoring server cert"); + debug!("ignoring server cert"); Ok(HandshakeSignatureValid::assertion()) } @@ -476,10 +478,10 @@ mod test { use futures_rustls::TlsAcceptor; use futures_rustls::TlsConnector; use futures_util::sink::SinkExt; - use log::debug; use tokio_util::codec::BytesCodec; use tokio_util::codec::Framed; use tokio_util::compat::FuturesAsyncReadCompatExt; + use tracing::debug; use fluvio_future::net::tcp_stream::stream; use fluvio_future::net::TcpListener; diff --git a/src/sync.rs b/src/sync.rs index 1bfbee3..b49c463 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -1 +1 @@ -pub use async_std::sync::*; +pub use async_lock::*; diff --git a/src/task.rs b/src/task.rs index e5ca8a0..32184eb 100644 --- a/src/task.rs +++ b/src/task.rs @@ -71,7 +71,7 @@ mod basic_test { use std::time; use futures_lite::future::zip; - use log::debug; + use tracing::debug; use crate::task::spawn; use crate::test_async; diff --git a/src/test_util.rs b/src/test_util.rs index dd53cc9..3b7a6e3 100644 --- a/src/test_util.rs +++ b/src/test_util.rs @@ -6,7 +6,7 @@ macro_rules! assert_async_block { #[cfg(not(target_arch = "wasm32"))] match fluvio_future::task::run_block_on(ft) { - Ok(_) => log::debug!("finished run"), + Ok(_) => debug!("finished run"), Err(err) => assert!(false, "error {:?}", err), } #[cfg(target_arch = "wasm32")] @@ -24,7 +24,7 @@ mod test { use futures_lite::future::poll_fn; use futures_lite::Future; - use log::debug; + use tracing::debug; use crate::test_async; diff --git a/src/timer.rs b/src/timer.rs index 21abcd9..601a017 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -82,8 +82,8 @@ mod test { use std::time::Duration; use std::time::Instant; - use log::debug; use tokio::select; + use tracing::debug; use crate::test_async; use crate::timer::sleep; diff --git a/src/zero_copy.rs b/src/zero_copy.rs index 4f3f71c..bf34ff7 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -9,8 +9,7 @@ use nix::libc::off_t; use nix::sys::sendfile::sendfile; use nix::Error as NixError; -use log::debug; -use log::trace; +use tracing::{debug, error, trace}; use crate::task::spawn_blocking; @@ -113,7 +112,7 @@ impl ZeroCopy { sleep(std::time::Duration::from_millis(10)); } _ => { - log::error!("error sendfile: {}", err); + error!("error sendfile: {}", err); return Err(err.into()); } }, @@ -179,7 +178,7 @@ impl ZeroCopy { debug!("EAGAIN, try again"); sleep(std::time::Duration::from_millis(10)); } else { - log::error!("error sendfile: {}", err); + error!("error sendfile: {}", err); return Err(err.into()); } } @@ -200,7 +199,7 @@ mod tests { use futures_lite::future::zip; use futures_util::stream::StreamExt; - use log::debug; + use tracing::debug; use crate::file_slice::AsyncFileSlice; use crate::fs::AsyncFileExtension; From 42f1ca5753cf2c2147153ea552bff5719e5a1198 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 10 Jul 2024 10:38:33 -0400 Subject: [PATCH 21/36] revert some --- .github/workflows/ci.yml | 2 +- Cargo.toml | 21 +++++---- fluvio-future-derive/Cargo.toml | 2 +- fluvio-future-derive/src/lib.rs | 81 +++++++++++++++++++++++++-------- src/doomsday.rs | 7 +-- src/future.rs | 66 +-------------------------- src/lib.rs | 15 ++++-- src/retry.rs | 9 ++-- src/task.rs | 26 ++++++----- src/test_util.rs | 6 +-- src/timer.rs | 3 +- src/zero_copy.rs | 7 ++- 12 files changed, 119 insertions(+), 126 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8151525..da59ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: run: | Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8" cargo install --force --locked bindgen-cli - cargo test --features task,subscriber,fixture,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry + cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry test: name: Check ${{ matrix.check }} on (${{ matrix.os }}) runs-on: ${{ matrix.os }} diff --git a/Cargo.toml b/Cargo.toml index 1e05143..4a18b4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,14 +12,15 @@ resolver = "2" all-features = true [features] -task = ["async-global-executor", "timer", "cfg-if"] +task = ["async-std/default", "timer", "cfg-if"] subscriber = [ "tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter", ] fixture = ["subscriber", "task", "fluvio-future-derive"] -io = ["async-io", "async-global-executor/async-io"] +task_unstable = ["task", "async-std/unstable"] +io = ["async-io"] sync = ["async-lock"] future = ["async-io", "pin-project"] net = [ @@ -29,6 +30,7 @@ net = [ "cfg-if", "futures-util/io", "socket2", + "ws_stream_wasm" ] tls = ["rust_tls"] rust_tls = [ @@ -53,20 +55,19 @@ openssl_tls = [ "pin-project", "futures-util/io", ] -timer = ["async-io", "pin-project", "futures-lite"] +timer = ["async-io", "pin-project", "futures-lite", "fluvio-wasm-timer"] fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"] -zero_copy = ["nix", "task"] -mmap = ["fs", "memmap2", "task"] +zero_copy = ["nix", "task_unstable"] +mmap = ["fs", "memmap2", "task_unstable"] retry = [] doomsday = ["task", "sync"] -tokio1 = ["async-global-executor/tokio"] +tokio1 = ["async-std/tokio1"] attributes = [] - [dependencies] anyhow = { version = "1.0" } -async-global-executor = { version = "2.4.1", default-features = false, optional = true } async-trait = { version = "0.1.80", optional = true } +async-std = { version = "1.12", default-features = false, optional = true } cfg-if = { version = "1.0", optional = true } fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0", optional = true } futures-lite = { version = "2.3", optional = true } @@ -94,8 +95,8 @@ rustls-pemfile = { version = "2.1", optional = true } socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] -fluvio-wasm-timer = "0.2.5" -ws_stream_wasm = "0.7.4" +fluvio-wasm-timer = { version = "0.2.5", optional = true } +ws_stream_wasm = { version = "0.7.4", optional = true } [dev-dependencies] diff --git a/fluvio-future-derive/Cargo.toml b/fluvio-future-derive/Cargo.toml index 829aa56..1dac70d 100644 --- a/fluvio-future-derive/Cargo.toml +++ b/fluvio-future-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fluvio-future-derive" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Fluvio Contributors "] description = "Procedure macro to run async fn as test" repository = "https://github.com/infinyon/future-aio" diff --git a/fluvio-future-derive/src/lib.rs b/fluvio-future-derive/src/lib.rs index 492a995..56747d8 100644 --- a/fluvio-future-derive/src/lib.rs +++ b/fluvio-future-derive/src/lib.rs @@ -1,7 +1,10 @@ +extern crate proc_macro; + use proc_macro::TokenStream; +use proc_macro2::Span; use quote::{quote, quote_spanned}; -use syn::{spanned::Spanned, AttributeArgs}; - +use syn::{Ident, ItemFn}; +use syn::spanned::Spanned; #[proc_macro_attribute] pub fn main_async(_attr: TokenStream, item: TokenStream) -> TokenStream { @@ -48,34 +51,76 @@ pub fn main_async(_attr: TokenStream, item: TokenStream) -> TokenStream { #[proc_macro_attribute] pub fn test_async(args: TokenStream, item: TokenStream) -> TokenStream { + use syn::AttributeArgs; + let attribute_args = syn::parse_macro_input!(args as AttributeArgs); + let input = syn::parse_macro_input!(item as ItemFn); + let name = &input.sig.ident; + let sync_name = format!("{}_sync", name); + let out_fn_iden = Ident::new(&sync_name, Span::call_site()); + let test_attributes = generate::generate_test_attributes(&attribute_args); - let input = syn::parse_macro_input!(item as syn::ItemFn); - let ret = &input.sig.output; + let expression = quote! { + + #[test] + #test_attributes + fn #out_fn_iden() { + + ::fluvio_future::subscriber::init_logger(); + + #input + + let ft = async { + #name().await + }; + + #[cfg(not(target_arch = "wasm32"))] + if let Err(err) = ::fluvio_future::task::run_block_on(ft) { + assert!(false,"error: {:?}",err); + } + #[cfg(target_arch = "wasm32")] + ::fluvio_future::task::run_block_on(ft); + + } + }; + + expression.into() +} + +#[proc_macro_attribute] +pub fn test(args: TokenStream, item: TokenStream) -> TokenStream { + use syn::AttributeArgs; + + let attribute_args = syn::parse_macro_input!(args as AttributeArgs); + let input = syn::parse_macro_input!(item as ItemFn); let name = &input.sig.ident; - let body = &input.block; - let attrs = &input.attrs; - let vis = &input.vis; + let sync_name = format!("{}_sync", name); + let out_fn_iden = Ident::new(&sync_name, Span::call_site()); - if input.sig.asyncness.is_none() { - return TokenStream::from(quote_spanned! { input.span() => - compile_error!("the async keyword is missing from the function declaration"), - }); - } + let test_attributes = generate::generate_test_attributes(&attribute_args); - let result = quote! { - #[::core::prelude::v1::test] + let expression = quote! { + + #[test] #test_attributes - #(#attrs)* - #vis fn #name() #ret { + fn #out_fn_iden() { + ::fluvio_future::subscriber::init_logger(); - ::fluvio_future::task::run_block_on(async { #body }) + #input + + let ft = async { + #name().await; + }; + + + ::fluvio_future::task::run_block_on(ft); + } }; - result.into() + expression.into() } mod generate { diff --git a/src/doomsday.rs b/src/doomsday.rs index 90a9f93..6d19a61 100644 --- a/src/doomsday.rs +++ b/src/doomsday.rs @@ -9,7 +9,7 @@ use std::{ use tracing::{debug, error, info}; use crate::sync::Mutex; -use crate::task::Task; +use crate::task::JoinHandle; #[derive(Clone)] /// DoomsdayTimer will configurably panic or exit if it is not @@ -40,7 +40,7 @@ impl DoomsdayTimer { /// Spawn a new doomsday timer. /// If `exit_on_explode` is true, it will terminate process with `exit(1)` if it explodes. /// Otherwise it will call `panic()`. Note that `awaiting` on the jh will panic if the `DoomsdayTimer` panicked - pub fn spawn(duration: Duration, exit_on_explode: bool) -> (Self, Task<()>) { + pub fn spawn(duration: Duration, exit_on_explode: bool) -> (Self, JoinHandle<()>) { let s = Self { time_to_explode: Arc::new(Mutex::new(Instant::now() + duration)), duration, @@ -112,10 +112,11 @@ mod tests { use std::io::Error; #[test_async(should_panic)] - async fn test_explode() { + async fn test_explode() -> Result<(), Error> { let (_, jh) = DoomsdayTimer::spawn(Duration::from_millis(1), false); crate::timer::sleep(Duration::from_millis(2)).await; jh.await; + Ok(()) } #[test_async] diff --git a/src/future.rs b/src/future.rs index 0c6a148..db35741 100644 --- a/src/future.rs +++ b/src/future.rs @@ -1,65 +1 @@ -use std::error::Error; -use std::fmt; -use std::future::Future; -use std::pin::Pin; -use std::task::{Context, Poll}; -use std::time::Duration; - -use async_io::Timer; -use pin_project::pin_project; - -/// Awaits a future or times out after a duration of time. -pub async fn timeout(dur: Duration, f: F) -> Result -where - F: Future, -{ - TimeoutFuture::new(f, dur).await -} - -/// A future that times out after a duration of time. -#[pin_project] -pub struct TimeoutFuture { - #[pin] - future: F, - #[pin] - delay: Timer, -} - -impl TimeoutFuture { - #[allow(dead_code)] - pub(super) fn new(future: F, dur: Duration) -> TimeoutFuture { - TimeoutFuture { - future, - delay: Timer::after(dur), - } - } -} - -impl Future for TimeoutFuture { - type Output = Result; - - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let this = self.project(); - match this.future.poll(cx) { - Poll::Ready(v) => Poll::Ready(Ok(v)), - Poll::Pending => match this.delay.poll(cx) { - Poll::Ready(_) => Poll::Ready(Err(TimeoutError { _private: () })), - Poll::Pending => Poll::Pending, - }, - } - } -} - -/// An error returned when a future times out. -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct TimeoutError { - _private: (), -} - -impl Error for TimeoutError {} - -impl fmt::Display for TimeoutError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - "future has timed out".fmt(f) - } -} +pub use async_std::future::*; diff --git a/src/lib.rs b/src/lib.rs index 754bad8..ef53b50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,8 @@ #[cfg(unix)] pub mod file_slice; -#[cfg(all(feature = "fs", not(target_arch = "wasm32")))] +#[cfg(feature = "fs")] +#[cfg(not(target_arch = "wasm32"))] pub mod fs; #[cfg(feature = "io")] @@ -23,7 +24,11 @@ mod test_util; #[cfg(any(test, feature = "fixture"))] pub use fluvio_future_derive::test_async; +#[cfg(any(test, feature = "fixture"))] +pub use fluvio_future_derive::test; + #[cfg(all(unix, feature = "zero_copy"))] +#[cfg(not(target_arch = "wasm32"))] pub mod zero_copy; #[cfg(feature = "net")] @@ -36,9 +41,11 @@ pub mod rust_tls; pub use rust_tls as tls; #[cfg(all(any(unix, windows), feature = "native_tls"))] +#[cfg(not(target_arch = "wasm32"))] pub mod native_tls; #[cfg(all(any(unix, windows), feature = "native_tls", not(feature = "rust_tls")))] +#[cfg(not(target_arch = "wasm32"))] pub use crate::native_tls as tls; #[cfg(feature = "openssl_tls")] @@ -46,6 +53,7 @@ pub use crate::native_tls as tls; pub mod openssl; #[cfg(feature = "sync")] +#[cfg(not(target_arch = "wasm32"))] pub mod sync; #[cfg(feature = "future")] @@ -70,10 +78,11 @@ pub mod subscriber { } #[cfg(feature = "doomsday")] +#[cfg(not(target_arch = "wasm32"))] pub mod doomsday; -#[cfg(feature = "attributes")] -pub use fluvio_future_derive::main_async; +// #[cfg(feature = "attributes")] +// pub use fluvio_future_derive::main_async; /// re-export tracing pub mod tracing { diff --git a/src/retry.rs b/src/retry.rs index a31974e..f486015 100644 --- a/src/retry.rs +++ b/src/retry.rs @@ -371,13 +371,12 @@ mod delay { #[cfg(test)] mod test { use super::*; - use fluvio_future_derive::test_async; use std::io::ErrorKind; use std::ops::AddAssign; use std::time::Duration; use tracing::debug; - #[test_async] + #[fluvio_future::test] async fn test_fixed_retries_no_delay() { let mut executed_retries = 0u8; let operation = || { @@ -394,7 +393,7 @@ mod test { assert_eq!(executed_retries, 3); } - #[test_async] + #[fluvio_future::test] async fn test_fixed_retries_timeout() { let mut executed_retries = 0u8; let operation = || { @@ -413,7 +412,7 @@ mod test { assert!(executed_retries < 10); } - #[test_async] + #[fluvio_future::test] async fn test_fixed_retries_not_retryable() { let mut executed_retries = 0u8; let operation = || { @@ -431,7 +430,7 @@ mod test { assert_eq!(executed_retries, 1); } - #[test_async] + #[fluvio_future::test] async fn test_conditional_retry() { let mut executed_retries = 0u8; let operation = || { diff --git a/src/task.rs b/src/task.rs index 32184eb..aa81cc2 100644 --- a/src/task.rs +++ b/src/task.rs @@ -1,8 +1,11 @@ use std::future::Future; +use async_std::task; + use crate::timer::sleep; -pub use async_global_executor::spawn_local; +#[cfg(feature = "task_unstable")] +pub use async_std::task::spawn_local; /// run future and wait forever /// this is typically used in the server @@ -10,7 +13,7 @@ pub fn run(spawn_closure: F) where F: Future + Send + 'static, { - async_global_executor::block_on(spawn_closure); + task::block_on(spawn_closure); } /// run future and wait forever @@ -21,7 +24,7 @@ where { use std::time::Duration; - async_global_executor::block_on(async { + task::block_on(async { spawn_closure.await; // do infinite loop for now loop { @@ -38,14 +41,15 @@ where cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { - pub use async_global_executor::spawn_local as spawn; + pub use async_std::task::spawn_local as spawn; } else { - pub use async_global_executor::spawn; + pub use async_std::task::spawn; } } +#[cfg(feature = "task_unstable")] #[cfg(not(target_arch = "wasm32"))] -pub use async_global_executor::spawn_blocking; +pub use async_std::task::spawn_blocking; cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { @@ -54,14 +58,14 @@ cfg_if::cfg_if! { F: Future + 'static, T: 'static, { - block_on(f) + task::block_on(f) } } else { - pub use async_global_executor::block_on as run_block_on; + pub use async_std::task::block_on as run_block_on; } } -pub use async_global_executor::Task; +pub use async_std::task::JoinHandle; #[cfg(test)] mod basic_test { @@ -129,8 +133,8 @@ mod basic_test { let core_threads = num_cpus::get().max(1); debug!("num threads: {}", core_threads); - spawn(ft1).detach(); - spawn(ft2).detach(); + spawn(ft1); + spawn(ft2); // wait for all futures complete thread::sleep(time::Duration::from_millis(2000)); diff --git a/src/test_util.rs b/src/test_util.rs index 3b7a6e3..4f1f045 100644 --- a/src/test_util.rs +++ b/src/test_util.rs @@ -10,7 +10,7 @@ macro_rules! assert_async_block { Err(err) => assert!(false, "error {:?}", err), } #[cfg(target_arch = "wasm32")] - fluvio_future::task::run_block_on(ft); + fluvio_future::task::run_block_on(ft) }}; } @@ -42,12 +42,12 @@ mod test { Ok(()) } - #[test_async] + #[fluvio_future::test] async fn simple_test() { assert_eq!(1, "x".len()); } - #[test_async(ignore)] + #[fluvio_future::test(ignore)] async fn simple_test_ignore() { assert_eq!(1, "x".len()); } diff --git a/src/timer.rs b/src/timer.rs index 601a017..97619fe 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -85,11 +85,10 @@ mod test { use tokio::select; use tracing::debug; - use crate::test_async; use crate::timer::sleep; /// test timer loop - #[test_async] + #[fluvio_future::test] async fn test_sleep() { let mut sleep_count: u16 = 0; let time_now = Instant::now(); diff --git a/src/zero_copy.rs b/src/zero_copy.rs index bf34ff7..585c9c8 100644 --- a/src/zero_copy.rs +++ b/src/zero_copy.rs @@ -205,14 +205,13 @@ mod tests { use crate::fs::AsyncFileExtension; use crate::net::tcp_stream::stream; use crate::net::TcpListener; - use crate::test_async; use crate::timer::sleep; use crate::{fs::util as file_util, zero_copy::ZeroCopy}; use futures_lite::AsyncReadExt; use super::SendFileError; - #[test_async] + #[fluvio_future::test] async fn test_zero_copy_simple() { let port = portpicker::pick_unused_port().expect("No free ports left"); let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port); @@ -256,7 +255,7 @@ mod tests { let _ = zip(client, server).await; } - #[test_async] + #[fluvio_future::test] async fn test_zero_copy_large_size() { const MAX_BYTES: usize = 3000000; @@ -356,7 +355,7 @@ mod tests { } /// test zero copy when len is too large - #[test_async] + #[fluvio_future::test] async fn test_zero_copy_large_slace() { let port = portpicker::pick_unused_port().expect("No free ports left"); let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port); From a51c4bd60fce9676e6bf12038dac418ffb63256d Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 10 Jul 2024 10:46:10 -0400 Subject: [PATCH 22/36] condvar --- Cargo.toml | 5 +++-- src/sync.rs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4a18b4d..470df54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ subscriber = [ fixture = ["subscriber", "task", "fluvio-future-derive"] task_unstable = ["task", "async-std/unstable"] io = ["async-io"] -sync = ["async-lock"] +sync = ["async-lock", "async-condvar-fair"] future = ["async-io", "pin-project"] net = [ "futures-lite", @@ -61,7 +61,7 @@ zero_copy = ["nix", "task_unstable"] mmap = ["fs", "memmap2", "task_unstable"] retry = [] doomsday = ["task", "sync"] -tokio1 = ["async-std/tokio1"] +tokio1 = ["async-std/tokio1", "async-condvar-fair/tokio"] attributes = [] [dependencies] @@ -80,6 +80,7 @@ tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.18", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +async-condvar-fair = { version = "1.0.1", optional = true, default-features = false, features = ["smol"] } async-fs = { version = "2.1", optional = true } async-io = { version = "2.3", optional = true } async-lock = { version = "3.4", optional = true } diff --git a/src/sync.rs b/src/sync.rs index b49c463..78a235b 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -1 +1,2 @@ pub use async_lock::*; +pub use async_condvar_fair::*; From 0a7edcba1734aa8186d798e8c8b5a37fee661962 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 10 Jul 2024 10:52:07 -0400 Subject: [PATCH 23/36] wasm --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 470df54..5f94d8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,6 @@ attributes = [] [dependencies] anyhow = { version = "1.0" } async-trait = { version = "0.1.80", optional = true } -async-std = { version = "1.12", default-features = false, optional = true } cfg-if = { version = "1.0", optional = true } fluvio-future-derive = { path = "fluvio-future-derive", version = "0.1.0", optional = true } futures-lite = { version = "2.3", optional = true } @@ -86,6 +85,7 @@ async-io = { version = "2.3", optional = true } async-lock = { version = "3.4", optional = true } async-native-tls = { version = "0.5.0", optional = true } async-net = { version = "2.0", optional = true } +async-std = { version = "1.12", default-features = false, optional = true } futures-rustls = { version = "0.26.0", optional = true } memmap2 = { version = "0.9.4", optional = true } native-tls = { version = "0.2.12", optional = true } @@ -96,6 +96,7 @@ rustls-pemfile = { version = "2.1", optional = true } socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] +async-std = { version = "1.12.0", default-features = false, features = ["unstable"], optional = true } fluvio-wasm-timer = { version = "0.2.5", optional = true } ws_stream_wasm = { version = "0.7.4", optional = true } From d64542c949b1300a17b6138c9ecf613dce580f38 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 10 Jul 2024 10:56:41 -0400 Subject: [PATCH 24/36] sync --- Cargo.toml | 6 ++---- src/sync.rs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5f94d8c..f73d91f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ subscriber = [ fixture = ["subscriber", "task", "fluvio-future-derive"] task_unstable = ["task", "async-std/unstable"] io = ["async-io"] -sync = ["async-lock", "async-condvar-fair"] +sync = ["async-std/default"] future = ["async-io", "pin-project"] net = [ "futures-lite", @@ -61,7 +61,7 @@ zero_copy = ["nix", "task_unstable"] mmap = ["fs", "memmap2", "task_unstable"] retry = [] doomsday = ["task", "sync"] -tokio1 = ["async-std/tokio1", "async-condvar-fair/tokio"] +tokio1 = ["async-std/tokio1"] attributes = [] [dependencies] @@ -79,10 +79,8 @@ tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.18", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -async-condvar-fair = { version = "1.0.1", optional = true, default-features = false, features = ["smol"] } async-fs = { version = "2.1", optional = true } async-io = { version = "2.3", optional = true } -async-lock = { version = "3.4", optional = true } async-native-tls = { version = "0.5.0", optional = true } async-net = { version = "2.0", optional = true } async-std = { version = "1.12", default-features = false, optional = true } diff --git a/src/sync.rs b/src/sync.rs index 78a235b..1bfbee3 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -1,2 +1 @@ -pub use async_lock::*; -pub use async_condvar_fair::*; +pub use async_std::sync::*; From da81d6d718735fef382241dcc808a10430a54085 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 10 Jul 2024 12:47:52 -0400 Subject: [PATCH 25/36] revert more --- Cargo.toml | 4 ++-- src/io.rs | 3 ++- src/lib.rs | 4 ++-- src/task.rs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f73d91f..3d575a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,9 +20,9 @@ subscriber = [ ] fixture = ["subscriber", "task", "fluvio-future-derive"] task_unstable = ["task", "async-std/unstable"] -io = ["async-io"] +io = ["async-std/default"] sync = ["async-std/default"] -future = ["async-io", "pin-project"] +future = ["async-std/default"] net = [ "futures-lite", "async-net", diff --git a/src/io.rs b/src/io.rs index 4815f8c..db385e5 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1 +1,2 @@ -pub use async_io::*; +pub use async_std::io::*; +pub use async_std::prelude::*; diff --git a/src/lib.rs b/src/lib.rs index ef53b50..23bdba3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,8 +81,8 @@ pub mod subscriber { #[cfg(not(target_arch = "wasm32"))] pub mod doomsday; -// #[cfg(feature = "attributes")] -// pub use fluvio_future_derive::main_async; +#[cfg(feature = "attributes")] +pub use fluvio_future_derive::main_async; /// re-export tracing pub mod tracing { diff --git a/src/task.rs b/src/task.rs index aa81cc2..28f1683 100644 --- a/src/task.rs +++ b/src/task.rs @@ -18,7 +18,7 @@ where /// run future and wait forever /// this is typically used in the server -pub fn main(spawn_closure: F) +pub fn main_forever(spawn_closure: F) where F: Future + Send + 'static, { From 0c5a462da4c64235723072af44f4acec47f165f0 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Wed, 10 Jul 2024 13:01:30 -0400 Subject: [PATCH 26/36] revert more --- src/lib.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 23bdba3..18f297d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,6 @@ pub use fluvio_future_derive::test_async; pub use fluvio_future_derive::test; #[cfg(all(unix, feature = "zero_copy"))] -#[cfg(not(target_arch = "wasm32"))] pub mod zero_copy; #[cfg(feature = "net")] @@ -41,11 +40,9 @@ pub mod rust_tls; pub use rust_tls as tls; #[cfg(all(any(unix, windows), feature = "native_tls"))] -#[cfg(not(target_arch = "wasm32"))] pub mod native_tls; #[cfg(all(any(unix, windows), feature = "native_tls", not(feature = "rust_tls")))] -#[cfg(not(target_arch = "wasm32"))] pub use crate::native_tls as tls; #[cfg(feature = "openssl_tls")] @@ -53,11 +50,9 @@ pub use crate::native_tls as tls; pub mod openssl; #[cfg(feature = "sync")] -#[cfg(not(target_arch = "wasm32"))] pub mod sync; #[cfg(feature = "future")] -#[cfg(not(target_arch = "wasm32"))] pub mod future; #[cfg(feature = "subscriber")] From 11da307401cdea9110d858c0fe7b8612254156d5 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 11 Jul 2024 10:19:21 -0400 Subject: [PATCH 27/36] cleanup --- .github/workflows/ci.yml | 6 +++-- CHANGELOG.md | 19 ++++++---------- Cargo.toml | 47 +++++++--------------------------------- src/task.rs | 25 --------------------- 4 files changed, 19 insertions(+), 78 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da59ff9..b3364cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,10 @@ jobs: with: key: windows-latest-test - uses: cargo-bins/cargo-binstall@main - - uses: ilammy/setup-nasm@v1 + - name: Install NASM for AWS-LC + uses: ilammy/setup-nasm@v1 + - name: Install bindgen-cli + run: cargo install --force --locked bindgen-cli - name: Test Setup run: | make certs @@ -30,7 +33,6 @@ jobs: - name: Test run: | Start-Process cmd -Args /c,"http-server --tls --tls-key certs/test-certs/server.key --tls-cert certs/test-certs/server.crt --tls-key-algorithm pkcs8" - cargo install --force --locked bindgen-cli cargo test --features task,subscriber,fixture,task_unstable,io,sync,future,net,tls,rust_tls,timer,fs,zero_copy,mmap,retry test: name: Check ${{ matrix.check }} on (${{ matrix.os }}) diff --git a/CHANGELOG.md b/CHANGELOG.md index 328f84d..07ca0c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,12 @@ # Release Notes -## Unreleased - -* Timer sleeper only fires once ([#258](https://github.com/infinyon/future-aio/pull/258)) -* Bump tokio from 1.33.0 to 1.37.0 -* Bump async-lock from 2.8.0 to 3.3.0 -* Bump async-fs from 1.6.0 to 2.1.2 -* Bump bytes from 1.4.0 to 1.6.0 -* Bump once_cell from 1.18.0 to 1.19.0 -* Bump async-net from 1.7.0 to 2.0.0 -* Bump async-native-tls from 0.4.0 to 0.5.0 -* Bump memmap2 from 0.5.10 to 0.9.3 -* Bump async-io from 1.13.0 to 2.3.2 +## 0.7.0 +* Update all depencencies to latest versions +* Timer sleeper only fires once +* Remove `http-client` +* Rename `native2_tls` feature to `native_tls` +* Note: `rustls` now uses `aws-lc` instead of `ring` + ## 0.5.0 * Move to `memmap2` because `memmap` is unmaintained. diff --git a/Cargo.toml b/Cargo.toml index 3d575a9..a10aa0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,54 +12,23 @@ resolver = "2" all-features = true [features] -task = ["async-std/default", "timer", "cfg-if"] -subscriber = [ - "tracing-subscriber", - "tracing-subscriber/std", - "tracing-subscriber/env-filter", -] +task = ["async-std/default", "cfg-if"] +subscriber = ["tracing-subscriber", "tracing-subscriber/std", "tracing-subscriber/env-filter"] fixture = ["subscriber", "task", "fluvio-future-derive"] task_unstable = ["task", "async-std/unstable"] io = ["async-std/default"] sync = ["async-std/default"] future = ["async-std/default"] -net = [ - "futures-lite", - "async-net", - "async-trait", - "cfg-if", - "futures-util/io", - "socket2", - "ws_stream_wasm" -] +net = ["futures-lite", "async-net", "async-trait", "cfg-if", "futures-util/io", "socket2", "ws_stream_wasm"] tls = ["rust_tls"] -rust_tls = [ - "net", - "rustls-pemfile", - "futures-rustls", - "pin-project", - "futures-util/io", -] -native_tls = [ - "net", - "pin-project", - "async-native-tls", - "dep:native-tls", - "openssl/vendored", - "futures-util/io", -] -openssl_tls = [ - "net", - "openssl", - "openssl-sys", - "pin-project", - "futures-util/io", -] +rust_tls = ["net", "rustls-pemfile", "futures-rustls", "pin-project", "futures-util/io"] +native_tls = ["net", "pin-project", "async-native-tls", "dep:native-tls", "openssl/vendored", "futures-util/io"] +openssl_tls = ["net", "openssl", "openssl-sys", "pin-project", "futures-util/io"] timer = ["async-io", "pin-project", "futures-lite", "fluvio-wasm-timer"] fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"] zero_copy = ["nix", "task_unstable"] mmap = ["fs", "memmap2", "task_unstable"] -retry = [] +retry = ["cfg-if"] doomsday = ["task", "sync"] tokio1 = ["async-std/tokio1"] attributes = [] @@ -94,7 +63,7 @@ rustls-pemfile = { version = "2.1", optional = true } socket2 = { version = "0.5.7", default-features = false, features = ["all"], optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] -async-std = { version = "1.12.0", default-features = false, features = ["unstable"], optional = true } +async-std = { version = "1.12", default-features = false, features = ["unstable"], optional = true } fluvio-wasm-timer = { version = "0.2.5", optional = true } ws_stream_wasm = { version = "0.7.4", optional = true } diff --git a/src/task.rs b/src/task.rs index 28f1683..c215f65 100644 --- a/src/task.rs +++ b/src/task.rs @@ -2,8 +2,6 @@ use std::future::Future; use async_std::task; -use crate::timer::sleep; - #[cfg(feature = "task_unstable")] pub use async_std::task::spawn_local; @@ -16,29 +14,6 @@ where task::block_on(spawn_closure); } -/// run future and wait forever -/// this is typically used in the server -pub fn main_forever(spawn_closure: F) -where - F: Future + Send + 'static, -{ - use std::time::Duration; - - task::block_on(async { - spawn_closure.await; - // do infinite loop for now - loop { - cfg_if::cfg_if! { - if #[cfg(target_arch = "wasm32")] { - sleep(Duration::from_secs(3600)).await.unwrap(); - } else { - sleep(Duration::from_secs(3600)).await; - } - } - } - }); -} - cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { pub use async_std::task::spawn_local as spawn; From 3274b66e7b04d83a4a337def795ef3a3c5589641 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 11 Jul 2024 10:23:16 -0400 Subject: [PATCH 28/36] revert Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d9b19e2..187e88b 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ test-macos: PFX_OPTS="" test-macos: certs cert-patch-macos test-derive setup-http-server run-test-macos run-test-macos: TEST_PORT=$$(cat tmp-PORT) cargo test \ - --features "task,subscriber,fixture,io,sync,future,net,tls,timer,fs,zero_copy,retry,doomsday,tokio1" + --features "task,subscriber,fixture,task_unstable,io,sync,future,net,tls,timer,fs,zero_copy,retry,doomsday,tokio1" $(MAKE) teardown-http-server install-wasm-pack: From 10901203a1c9f0f0b3d781eb015a8aaea0d7f606 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 11 Jul 2024 13:03:12 -0400 Subject: [PATCH 29/36] use anyhow --- src/rust_tls.rs | 90 ++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 614b183..84dfb19 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -38,72 +38,57 @@ mod cert { use std::fs::File; use std::io::BufRead; use std::io::BufReader; - use std::io::Error as IoError; - use std::io::ErrorKind; use std::path::Path; + use anyhow::{anyhow, Context, Result}; use futures_rustls::rustls::pki_types::CertificateDer; use futures_rustls::rustls::pki_types::PrivateKeyDer; use futures_rustls::rustls::RootCertStore; use rustls_pemfile::certs; use rustls_pemfile::pkcs8_private_keys; - pub fn load_certs>(path: P) -> Result>, IoError> { + pub fn load_certs>(path: P) -> Result>> { load_certs_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_certs_from_reader( - rd: &mut dyn BufRead, - ) -> Result>, IoError> { - certs(rd) - .map(|r| r.map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))) - .collect() + pub fn load_certs_from_reader(rd: &mut dyn BufRead) -> Result>> { + certs(rd).map(|r| r.context("invalid cert")).collect() } /// Load the passed keys file - pub fn load_keys>(path: P) -> Result>, IoError> { + pub fn load_keys>(path: P) -> Result>> { load_keys_from_reader(&mut BufReader::new(File::open(path)?)) } - pub fn load_keys_from_reader( - rd: &mut dyn BufRead, - ) -> Result>, IoError> { + pub fn load_keys_from_reader(rd: &mut dyn BufRead) -> Result>> { pkcs8_private_keys(rd) - .map(|r| { - r.map(|p| p.into()) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid key")) - }) + .map(|r| r.map(|p| p.into()).context("invalid key")) .collect() } - pub(crate) fn load_first_key>( - path: P, - ) -> Result, IoError> { + pub(crate) fn load_first_key>(path: P) -> Result> { load_first_key_from_reader(&mut BufReader::new(File::open(path)?)) } pub(crate) fn load_first_key_from_reader( rd: &mut dyn BufRead, - ) -> Result, IoError> { + ) -> Result> { let mut keys = load_keys_from_reader(rd)?; if keys.is_empty() { - Err(IoError::new(ErrorKind::InvalidInput, "no keys found")) + Err(anyhow!("no keys found")) } else { Ok(keys.remove(0)) } } - pub fn load_root_ca>(path: P) -> Result { - let certs = load_certs(path) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; + pub fn load_root_ca>(path: P) -> Result { + let certs = load_certs(path).map_err(|err| err.context("invalid ca crt"))?; let mut root_store = RootCertStore::empty(); for cert in certs { - root_store - .add(cert) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; + root_store.add(cert).context("invalid ca crt")?; } Ok(root_store) @@ -112,7 +97,6 @@ mod cert { mod connector { use std::io::Error as IoError; - use std::io::ErrorKind; use async_trait::async_trait; @@ -224,8 +208,6 @@ mod connector { mod builder { use std::io::Cursor; - use std::io::Error as IoError; - use std::io::ErrorKind; use std::path::Path; use std::sync::Arc; @@ -249,7 +231,8 @@ mod builder { use futures_rustls::TlsAcceptor; use futures_rustls::TlsConnector; - use tracing::debug; + use anyhow::{Context, Result}; + use tracing::info; use super::load_root_ca; use super::{load_certs, load_first_key_from_reader}; @@ -271,7 +254,7 @@ mod builder { pub fn load_ca_cert>( self, path: P, - ) -> Result, IoError> { + ) -> Result> { let certs = load_certs(path)?; self.with_root_certificates(certs) } @@ -279,7 +262,7 @@ mod builder { pub fn load_ca_cert_from_bytes( self, buffer: &[u8], - ) -> Result, IoError> { + ) -> Result> { let certs = load_certs_from_reader(&mut Cursor::new(buffer))?; self.with_root_certificates(certs) } @@ -297,13 +280,11 @@ mod builder { fn with_root_certificates( self, certs: Vec, - ) -> Result, IoError> { + ) -> Result> { let mut root_store = RootCertStore::empty(); for cert in certs { - root_store - .add(cert) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid ca crt"))?; + root_store.add(cert).context("invalid ca crt")?; } Ok(ConnectorBuilderStage( @@ -317,7 +298,7 @@ mod builder { self, cert_path: P, key_path: P, - ) -> Result { + ) -> Result { let certs = load_certs(cert_path)?; let key = load_first_key(key_path)?; self.with_single_cert(certs, key) @@ -327,7 +308,7 @@ mod builder { self, cert_buf: &[u8], key_buf: &[u8], - ) -> Result { + ) -> Result { let certs = load_certs_from_reader(&mut Cursor::new(cert_buf))?; let key = load_first_key_from_reader(&mut Cursor::new(key_buf))?; self.with_single_cert(certs, key) @@ -341,11 +322,11 @@ mod builder { self, certs: Vec>, key: PrivateKeyDer<'static>, - ) -> Result { + ) -> Result { let config = self .0 .with_client_auth_cert(certs, key) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))?; + .context("invalid cert")?; Ok(ConnectorBuilderWithConfig(config)) } @@ -379,12 +360,12 @@ mod builder { pub fn client_authenticate>( self, path: P, - ) -> Result, IoError> { + ) -> Result> { let root_store = load_root_ca(path)?; let client_verifier = WebPkiClientVerifier::builder(root_store.into()) .build() - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid verifier"))?; + .context("invalid verifier")?; Ok(AcceptorBuilderStage( self.0.with_client_cert_verifier(client_verifier), @@ -397,14 +378,14 @@ mod builder { self, cert_path: impl AsRef, key_path: impl AsRef, - ) -> Result { + ) -> Result { let certs = load_certs(cert_path)?; let key = load_first_key(key_path)?; let config = self .0 .with_single_cert(certs, key) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))?; + .context("invalid cert")?; Ok(AcceptorBuilderWithConfig(config)) } @@ -430,7 +411,7 @@ mod builder { _ocsp_response: &[u8], _now: UnixTime, ) -> Result { - debug!("ignoring server cert"); + info!("ignoring server cert"); Ok(ServerCertVerified::assertion()) } @@ -440,7 +421,7 @@ mod builder { _cert: &CertificateDer<'_>, _dss: &futures_rustls::rustls::DigitallySignedStruct, ) -> Result { - debug!("ignoring server cert"); + info!("ignoring server cert"); Ok(HandshakeSignatureValid::assertion()) } @@ -450,7 +431,7 @@ mod builder { _cert: &CertificateDer<'_>, _dss: &futures_rustls::rustls::DigitallySignedStruct, ) -> Result { - debug!("ignoring server cert"); + info!("ignoring server cert"); Ok(HandshakeSignatureValid::assertion()) } @@ -466,7 +447,6 @@ mod builder { #[cfg(test)] mod test { - use std::io::Error as IoError; use std::net::SocketAddr; use std::time; @@ -488,6 +468,8 @@ mod test { use fluvio_future::test_async; use fluvio_future::timer::sleep; + use anyhow::Result; + use super::{AcceptorBuilder, ConnectorBuilder}; const CA_PATH: &str = "certs/test-certs/ca.crt"; @@ -500,7 +482,7 @@ mod test { } #[test_async(ignore)] - async fn test_rust_tls_all() -> Result<(), IoError> { + async fn test_rust_tls_all() -> Result<()> { test_rustls( AcceptorBuilder::with_safe_defaults() .no_client_authentication() @@ -531,7 +513,7 @@ mod test { Ok(()) } - async fn test_rustls(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), IoError> { + async fn test_rustls(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> { let addr = "127.0.0.1:19998".parse::().expect("parse"); let server_ft = async { @@ -575,7 +557,7 @@ mod test { .expect("send failed"); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let client_ft = async { @@ -610,7 +592,7 @@ mod test { assert_eq!(message, format!("message{}reply", i)); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let _ = zip(client_ft, server_ft).await; From a728680dd8e9e09f59bc91552572c3d0f3ac345c Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 12:04:55 -0400 Subject: [PATCH 30/36] tls anyhow --- src/native_tls.rs | 199 ++++++------------------------------- src/net/mod.rs | 29 +++--- src/openssl/acceptor.rs | 7 +- src/openssl/certificate.rs | 3 +- src/openssl/connector.rs | 59 ++++------- src/openssl/error.rs | 39 -------- src/openssl/handshake.rs | 8 +- src/openssl/mod.rs | 2 - src/openssl/test.rs | 11 +- src/rust_tls.rs | 25 ++--- 10 files changed, 83 insertions(+), 299 deletions(-) delete mode 100644 src/openssl/error.rs diff --git a/src/native_tls.rs b/src/native_tls.rs index 4f2772a..572361a 100644 --- a/src/native_tls.rs +++ b/src/native_tls.rs @@ -29,12 +29,9 @@ mod split { } mod connector { - - use std::io::Error as IoError; - use std::io::ErrorKind; use std::sync::Arc; - use async_native_tls::Error as NativeTlsError; + use anyhow::{Context, Result}; use async_trait::async_trait; use tracing::debug; @@ -46,23 +43,6 @@ mod connector { use super::*; - pub enum TlsError { - Io(IoError), - Native(NativeTlsError), - } - - impl From for TlsError { - fn from(error: IoError) -> Self { - Self::Io(error) - } - } - - impl From for TlsError { - fn from(error: NativeTlsError) -> TlsError { - Self::Native(error) - } - } - /// connect as anonymous client #[derive(Clone)] pub struct TlsAnonymousConnector(Arc); @@ -78,19 +58,14 @@ mod connector { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { let tcp_stream = stream(domain).await?; let fd = tcp_stream.as_connection_fd(); let (write, read) = self .0 .connect(domain, tcp_stream) .await - .map_err(|e| { - IoError::new( - ErrorKind::ConnectionRefused, - format!("failed to connect: {}", e), - ) - })? + .context("failed to connect")? .split_connection(); Ok((write, read, fd)) } @@ -133,7 +108,7 @@ mod connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { debug!("connect to tls addr: {}", addr); let socket_opts = SocketOpts { keepalive: Some(Default::default()), @@ -147,12 +122,7 @@ mod connector { .connector .connect(&self.domain, tcp_stream) .await - .map_err(|e| { - IoError::new( - ErrorKind::ConnectionRefused, - format!("failed to connect: {}", e), - ) - })? + .context("failed to connect")? .split_connection(); Ok((write, read, fd)) } @@ -172,10 +142,8 @@ mod connector { pub use cert::*; mod cert { - use std::io::Error as IoError; - use std::io::ErrorKind; - use crate::net::certs::CertBuilder; + use anyhow::{Context, Result}; use native_tls::Certificate as NativeCertificate; use native_tls::Identity; use openssl::pkcs12::Pkcs12; @@ -193,20 +161,13 @@ mod cert { } impl X509PemBuilder { - pub fn build(self) -> Result { - let cert = Certificate::from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid cert: {}", err)) - })?; + pub fn build(self) -> Result { + let cert = Certificate::from_pem(&self.0).context("invalid cert")?; Ok(cert) } - pub fn build_native(self) -> Result { - NativeCertificate::from_pem(&self.0).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("invalid pem file: {}", err), - ) - }) + pub fn build_native(self) -> Result { + NativeCertificate::from_pem(&self.0).context("invalid pem file") } } @@ -219,10 +180,8 @@ mod cert { } impl PrivateKeyBuilder { - pub fn build(self) -> Result { - let key = PrivateKey::private_key_from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid key: {}", err)) - })?; + pub fn build(self) -> Result { + let key = PrivateKey::private_key_from_pem(&self.0).context("invalid key")?; Ok(key) } } @@ -239,7 +198,7 @@ mod cert { impl IdentityBuilder { /// load pk12 from x509 certs - pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { + pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { let server_key = key.build()?; let server_crt = x509.build()?; let p12 = Pkcs12::builder() @@ -247,21 +206,14 @@ mod cert { .pkey(&server_key) .cert(&server_crt) .build2(PASSWORD) - .map_err(|e| { - IoError::new( - ErrorKind::InvalidData, - format!("Failed to create Pkcs12: {}", e), - ) - })?; + .context("Failed to create Pkcs12")?; let der = p12.to_der()?; Ok(Self(der)) } - pub fn build(self) -> Result { - Identity::from_pkcs12(&self.0, PASSWORD).map_err(|e| { - IoError::new(ErrorKind::InvalidData, format!("Failed to load der: {}", e)) - }) + pub fn build(self) -> Result { + Identity::from_pkcs12(&self.0, PASSWORD).context("Failed to load der") } } } @@ -269,10 +221,7 @@ mod cert { pub use builder::*; mod builder { - - use std::io::Error as IoError; - use std::io::ErrorKind; - + use anyhow::{Context, Result}; use native_tls::Identity; use native_tls::TlsAcceptor as NativeTlsAcceptor; @@ -284,10 +233,9 @@ mod builder { pub struct ConnectorBuilder(TlsConnector); impl ConnectorBuilder { - pub fn identity(builder: IdentityBuilder) -> Result { + pub fn identity(builder: IdentityBuilder) -> Result { let identity = builder.build()?; let connector = TlsConnector::new().identity(identity); - //connector.min_protocol_version(Some()) Ok(Self(connector)) } @@ -313,7 +261,7 @@ mod builder { Self(connector) } - pub fn add_root_certificate(self, builder: X509PemBuilder) -> Result { + pub fn add_root_certificate(self, builder: X509PemBuilder) -> Result { let certificate = builder.build_native()?; let connector = self.0.add_root_certificate(certificate); Ok(Self(connector)) @@ -327,104 +275,25 @@ mod builder { pub struct AcceptorBuilder(Identity); impl AcceptorBuilder { - pub fn identity(builder: IdentityBuilder) -> Result { + pub fn identity(builder: IdentityBuilder) -> Result { let identity = builder.build()?; Ok(Self(identity)) } - pub fn build(self) -> Result { - let acceptor = NativeTlsAcceptor::new(self.0) - .map_err(|_| IoError::new(ErrorKind::InvalidInput, "invalid cert"))?; + pub fn build(self) -> Result { + let acceptor = NativeTlsAcceptor::new(self.0).context("invalid cert")?; Ok(acceptor.into()) } } } -#[deprecated] -#[allow(deprecated)] -pub use stream::AllTcpStream; - -mod stream { - - use std::io; - use std::pin::Pin; - use std::task::{Context, Poll}; - - use super::DefaultClientTlsStream; - use super::TcpStream; - use futures_lite::{AsyncRead, AsyncWrite}; - use pin_project::pin_project; - - #[deprecated] - #[pin_project(project = EnumProj)] - pub enum AllTcpStream { - Tcp(#[pin] TcpStream), - Tls(#[pin] DefaultClientTlsStream), - } - - #[allow(deprecated)] - impl AllTcpStream { - pub fn tcp(stream: TcpStream) -> Self { - #[allow(deprecated)] - Self::Tcp(stream) - } - - pub fn tls(stream: DefaultClientTlsStream) -> Self { - #[allow(deprecated)] - Self::Tls(stream) - } - } - - #[allow(deprecated)] - impl AsyncRead for AllTcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_read(cx, buf), - EnumProj::Tls(stream) => stream.poll_read(cx, buf), - } - } - } - - #[allow(deprecated)] - impl AsyncWrite for AllTcpStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &[u8], - ) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_write(cx, buf), - EnumProj::Tls(stream) => stream.poll_write(cx, buf), - } - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_flush(cx), - EnumProj::Tls(stream) => stream.poll_flush(cx), - } - } - - fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_close(cx), - EnumProj::Tls(stream) => stream.poll_close(cx), - } - } - } -} - #[cfg(test)] mod test { - use std::io::Error as IoError; use std::net::SocketAddr; use std::time; + use anyhow::Result; use async_native_tls::TlsAcceptor; use async_native_tls::TlsConnector; use bytes::Buf; @@ -445,10 +314,8 @@ mod test { use crate::test_async; use crate::timer::sleep; - #[allow(deprecated)] use super::{ - AcceptorBuilder, AllTcpStream, ConnectorBuilder, IdentityBuilder, PrivateKeyBuilder, - X509PemBuilder, + AcceptorBuilder, ConnectorBuilder, IdentityBuilder, PrivateKeyBuilder, X509PemBuilder, }; const CA_PATH: &str = "certs/test-certs/ca.crt"; @@ -466,7 +333,7 @@ mod test { } #[test_async] - async fn test_native_tls_pk12() -> Result<(), IoError> { + async fn test_native_tls_pk12() -> Result<()> { const PK12_PORT: u16 = 9900; let acceptor = AcceptorBuilder::identity( @@ -507,7 +374,7 @@ mod test { #[test_async] #[cfg(not(windows))] - async fn test_native_tls_x509() -> Result<(), IoError> { + async fn test_native_tls_x509() -> Result<()> { const X500_PORT: u16 = 9910; let acceptor = AcceptorBuilder::identity( @@ -568,11 +435,7 @@ mod test { Ok(()) } - async fn test_tls( - port: u16, - acceptor: TlsAcceptor, - connector: TlsConnector, - ) -> Result<(), IoError> { + async fn test_tls(port: u16, acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> { const TEST_ITERATION: u16 = 2; let addr = format!("127.0.0.1:{}", port) @@ -606,7 +469,7 @@ mod test { // sleep 1 seconds so we don't lost connection sleep(time::Duration::from_secs(1)).await; - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let client_ft = async { @@ -619,9 +482,7 @@ mod test { .await .expect("tls failed"); - #[allow(deprecated)] - let all_stream = AllTcpStream::Tls(tls_stream); - let mut framed = Framed::new(all_stream.compat(), BytesCodec::new()); + let mut framed = Framed::new(tls_stream.compat(), BytesCodec::new()); debug!("client: got connection. waiting"); for i in 0..TEST_ITERATION { @@ -641,7 +502,7 @@ mod test { assert_eq!(values.len(), 2); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let _ = zip(client_ft, server_ft).await; diff --git a/src/net/mod.rs b/src/net/mod.rs index e71d0ae..30d9184 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -9,19 +9,15 @@ pub use conn::*; #[cfg(not(target_arch = "wasm32"))] pub use unix_connector::DefaultTcpDomainConnector as DefaultDomainConnector; -#[cfg(not(target_arch = "wasm32"))] -#[deprecated(since = "0.3.3", note = "Please use the bar DefaultDomainConnector")] -pub use unix_connector::DefaultTcpDomainConnector; - #[cfg(target_arch = "wasm32")] pub use wasm_connector::DefaultDomainWebsocketConnector as DefaultDomainConnector; mod conn { - use std::io::Error as IoError; - + use anyhow::Result; use async_trait::async_trait; use futures_lite::io::{AsyncRead, AsyncWrite}; + pub trait Connection: AsyncRead + AsyncWrite + Send + Sync + Unpin + SplitConnection {} impl Connection for T {} @@ -75,7 +71,7 @@ mod conn { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError>; + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)>; // create new version of my self with new domain fn new_domain(&self, domain: String) -> DomainConnector; @@ -90,21 +86,21 @@ pub mod certs { use std::fs::File; use std::io::BufRead; use std::io::BufReader; - use std::io::Error as IoError; use std::path::Path; + use anyhow::Result; use tracing::debug; pub trait CertBuilder: Sized { fn new(bytes: Vec) -> Self; - fn from_reader(reader: &mut dyn BufRead) -> Result { + fn from_reader(reader: &mut dyn BufRead) -> Result { let mut bytes = vec![]; reader.read_to_end(&mut bytes)?; Ok(Self::new(bytes)) } - fn from_path(path: impl AsRef) -> Result { + fn from_path(path: impl AsRef) -> Result { debug!("loading cert from: {}", path.as_ref().display()); let mut reader = BufReader::new(File::open(path)?); Self::from_reader(&mut reader) @@ -115,10 +111,11 @@ pub mod certs { #[cfg(target_arch = "wasm32")] mod wasm_connector { use super::*; + use anyhow::Result; use async_trait::async_trait; use futures_util::io::AsyncReadExt; - use std::io::Error as IoError; use ws_stream_wasm::WsMeta; + #[derive(Clone, Default)] pub struct DefaultDomainWebsocketConnector {} impl DefaultDomainWebsocketConnector { @@ -131,10 +128,9 @@ mod wasm_connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { let (mut _ws, wsstream) = WsMeta::connect(addr, None) - .await - .map_err(|e| IoError::new(std::io::ErrorKind::Other, e))?; + .await?; let wsstream_io = wsstream.into_io(); let (stream, sink) = wsstream_io.split(); Ok((Box::new(sink), Box::new(stream), String::from(addr))) @@ -152,8 +148,7 @@ mod wasm_connector { #[cfg(not(target_arch = "wasm32"))] mod unix_connector { - use std::io::Error as IoError; - + use anyhow::Result; use async_trait::async_trait; use tracing::debug; @@ -182,7 +177,7 @@ mod unix_connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { debug!("connect to tcp addr: {}", addr); let tcp_stream = stream(addr).await?; diff --git a/src/openssl/acceptor.rs b/src/openssl/acceptor.rs index 675700a..22ac124 100644 --- a/src/openssl/acceptor.rs +++ b/src/openssl/acceptor.rs @@ -1,12 +1,13 @@ -use futures_lite::io::{AsyncRead, AsyncWrite}; -use openssl::ssl; use std::fmt; use std::path::Path; use std::sync::Arc; +use anyhow::Result; +use futures_lite::io::{AsyncRead, AsyncWrite}; +use openssl::ssl; + use super::async_to_sync_wrapper::AsyncToSyncWrapper; use super::certificate::{Certificate, PrivateKey}; -use super::error::Result; use super::handshake::HandshakeFuture; use super::stream::TlsStream; diff --git a/src/openssl/certificate.rs b/src/openssl/certificate.rs index fa6ad8f..a3257e5 100644 --- a/src/openssl/certificate.rs +++ b/src/openssl/certificate.rs @@ -1,8 +1,7 @@ +use anyhow::Result; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; -use super::error::Result; - #[derive(Debug)] pub struct Certificate(pub X509); diff --git a/src/openssl/connector.rs b/src/openssl/connector.rs index 0b87a62..c812161 100644 --- a/src/openssl/connector.rs +++ b/src/openssl/connector.rs @@ -1,7 +1,7 @@ use std::fmt; -use std::io; use std::path::Path; +use anyhow::{Context, Result}; use async_trait::async_trait; use futures_lite::io::{AsyncRead, AsyncWrite}; use openssl::ssl; @@ -16,7 +16,6 @@ use crate::net::{ use super::async_to_sync_wrapper::AsyncToSyncWrapper; use super::certificate::Certificate; -use super::error::Result; use super::handshake::HandshakeFuture; use super::stream::TlsStream; @@ -24,9 +23,7 @@ use super::stream::TlsStream; // TODO: simplification pub mod certs { - use std::io::Error as IoError; - use std::io::ErrorKind; - + use anyhow::{Context, Result}; use openssl::pkcs12::Pkcs12; use openssl::pkey::Private; @@ -41,7 +38,7 @@ pub mod certs { // copied from https://github.com/sfackler/rust-native-tls/blob/master/src/imp/openssl.rs mod identity_impl { - use crate::openssl::TlsError::CertReadError; + use anyhow::{anyhow, Result}; use openssl::pkcs12::Pkcs12; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; @@ -54,17 +51,13 @@ pub mod certs { } impl Identity { - pub fn from_pkcs12(buf: &[u8], pass: &str) -> anyhow::Result { + pub fn from_pkcs12(buf: &[u8], pass: &str) -> Result { let pkcs12 = Pkcs12::from_der(buf)?; let parsed = pkcs12 .parse2(pass) - .map_err(|_| CertReadError(String::from("Couldn't read pkcs12")))?; - let pkey = parsed - .pkey - .ok_or(CertReadError(String::from("Missing private key")))?; - let cert = parsed - .cert - .ok_or(CertReadError(String::from("Missing cert")))?; + .map_err(|err| anyhow!("Couldn't read pkcs12 {err}"))?; + let pkey = parsed.pkey.ok_or(anyhow!("Missing private key"))?; + let cert = parsed.cert.ok_or(anyhow!("Missing cert"))?; Ok(Identity { pkey, cert, @@ -95,10 +88,8 @@ pub mod certs { } impl X509PemBuilder { - pub fn build(self) -> Result { - let cert = Certificate::from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid cert: {}", err)) - })?; + pub fn build(self) -> Result { + let cert = Certificate::from_pem(&self.0).context("invalid cert")?; Ok(cert) } } @@ -114,10 +105,8 @@ pub mod certs { } impl PrivateKeyBuilder { - pub fn build(self) -> Result { - let key = PrivateKey::private_key_from_pem(&self.0).map_err(|err| { - IoError::new(ErrorKind::InvalidInput, format!("invalid key: {}", err)) - })?; + pub fn build(self) -> Result { + let key = PrivateKey::private_key_from_pem(&self.0).context("invalid key")?; Ok(key) } } @@ -132,7 +121,7 @@ pub mod certs { impl IdentityBuilder { /// load pk12 from x509 certs - pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { + pub fn from_x509(x509: X509PemBuilder, key: PrivateKeyBuilder) -> Result { let server_key = key.build()?; let server_crt = x509.build()?; let p12 = Pkcs12::builder() @@ -140,21 +129,14 @@ pub mod certs { .pkey(&server_key) .cert(server_crt.inner()) .build2(PASSWORD) - .map_err(|e| { - IoError::new( - ErrorKind::InvalidData, - format!("Failed to create Pkcs12: {}", e), - ) - })?; + .context("Failed to create Pkcs12")?; let der = p12.to_der()?; Ok(Self(der)) } - pub fn build(self) -> Result { - Identity::from_pkcs12(&self.0, PASSWORD).map_err(|e| { - IoError::new(ErrorKind::InvalidData, format!("Failed to load der: {}", e)) - }) + pub fn build(self) -> Result { + Identity::from_pkcs12(&self.0, PASSWORD).context("Failed to load der") } } } @@ -196,6 +178,7 @@ impl TlsConnector { AsyncToSyncWrapper::new(stream), ) .await + .map_err(|err| anyhow::anyhow!("oe {err}")) } } @@ -243,7 +226,7 @@ impl TlsConnectorBuilder { /// set identity pub fn with_identity(mut self, builder: certs::IdentityBuilder) -> Result { - let identity = builder.build()?; + let identity = builder.build().context("failed to build identity")?; self.inner.set_certificate(identity.cert())?; self.inner.set_private_key(identity.pkey())?; for cert in identity.chain().iter().rev() { @@ -276,7 +259,7 @@ impl TcpDomainConnector for TlsAnonymousConnector { async fn connect( &self, domain: &str, - ) -> io::Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { debug!("tcp connect: {}", domain); let socket_opts = SocketOpts { keepalive: Some(Default::default()), @@ -289,7 +272,7 @@ impl TcpDomainConnector for TlsAnonymousConnector { .0 .connect(domain, tcp_stream) .await - .map_err(|err| err.into_io_error())? + .map_err(|err| anyhow::anyhow!(err))? .split_connection(); Ok((write, read, fd)) @@ -321,7 +304,7 @@ impl TcpDomainConnector for TlsDomainConnector { async fn connect( &self, addr: &str, - ) -> io::Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { debug!("connect to tls addr: {}", addr); let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); @@ -330,7 +313,7 @@ impl TcpDomainConnector for TlsDomainConnector { .connector .connect(&self.domain, tcp_stream) .await - .map_err(|err| err.into_io_error())? + .map_err(|err| anyhow::anyhow!(err))? .split_connection(); debug!("connect to tls domain: {}", self.domain); diff --git a/src/openssl/error.rs b/src/openssl/error.rs deleted file mode 100644 index 9bc0910..0000000 --- a/src/openssl/error.rs +++ /dev/null @@ -1,39 +0,0 @@ -use std::fmt::Debug; - -use thiserror::Error; - -use super::async_to_sync_wrapper::AsyncToSyncWrapper; - -#[derive(Error, Debug)] -pub enum Error { - #[error("CertReadError: {0}")] - CertReadError(String), - - #[error("OpenSslError: {0}")] - OpenSslError(#[from] openssl::error::Error), - - #[error("HandshakeError: {0}")] - HandshakeError(Box), - - #[error("ErrorStack: {0}")] - ErrorStack(#[from] openssl::error::ErrorStack), - - #[error("IoError: {0}")] - IoError(#[from] std::io::Error), -} - -impl From>> - for Error -{ - fn from(handshake_error: openssl::ssl::HandshakeError>) -> Self { - Self::HandshakeError(Box::new(handshake_error)) - } -} - -impl Error { - pub fn into_io_error(self) -> std::io::Error { - std::io::Error::new(std::io::ErrorKind::Other, self) - } -} - -pub type Result = std::result::Result; diff --git a/src/openssl/handshake.rs b/src/openssl/handshake.rs index 209332f..3f42530 100644 --- a/src/openssl/handshake.rs +++ b/src/openssl/handshake.rs @@ -6,10 +6,10 @@ use std::result; use std::task::Context; use std::task::Poll; +use anyhow::{Error, Result}; use futures_lite::io::{AsyncRead, AsyncWrite}; use super::async_to_sync_wrapper::AsyncToSyncWrapper; -use super::error::Error; use super::stream::TlsStream; pub(super) enum HandshakeFuture { @@ -29,7 +29,7 @@ where >, Self: Unpin, { - type Output = Result, Error>; + type Output = Result>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let self_mut = self.get_mut(); @@ -47,7 +47,7 @@ where *self_mut = HandshakeFuture::MidHandshake(mid); Poll::Pending } - Err(e) => Poll::Ready(Err(Error::from(e))), + Err(e) => Poll::Ready(Err(Error::new(e))), } } HandshakeFuture::MidHandshake(mut stream) => { @@ -62,7 +62,7 @@ where *self_mut = HandshakeFuture::MidHandshake(mid); Poll::Pending } - Err(e) => Poll::Ready(Err(Error::from(e))), + Err(e) => Poll::Ready(Err(Error::new(e))), } } HandshakeFuture::Done => panic!("Future must not be polled after ready"), diff --git a/src/openssl/mod.rs b/src/openssl/mod.rs index 66ccda8..1674b32 100644 --- a/src/openssl/mod.rs +++ b/src/openssl/mod.rs @@ -2,7 +2,6 @@ mod acceptor; mod async_to_sync_wrapper; mod certificate; mod connector; -mod error; mod handshake; mod stream; @@ -14,7 +13,6 @@ pub use certificate::Certificate; pub use connector::{ certs, TlsAnonymousConnector, TlsConnector, TlsConnectorBuilder, TlsDomainConnector, }; -pub use error::Error as TlsError; pub use openssl::ssl::SslVerifyMode; pub use stream::{AllTcpStream, TlsStream}; diff --git a/src/openssl/test.rs b/src/openssl/test.rs index a4232ed..2bc46eb 100644 --- a/src/openssl/test.rs +++ b/src/openssl/test.rs @@ -1,7 +1,7 @@ -use std::io::Error as IoError; use std::net::SocketAddr; use std::time; +use anyhow::Result; use bytes::BufMut; use bytes::Bytes; use bytes::BytesMut; @@ -17,7 +17,6 @@ use crate::net::{tcp_stream::stream, TcpListener}; use crate::test_async; use crate::timer::sleep; -use super::TlsError; use super::{AllTcpStream, TlsAcceptor, TlsConnector}; const CA_PATH: &str = "certs/test-certs/ca.crt"; @@ -31,7 +30,7 @@ fn to_bytes(bytes: Vec) -> Bytes { } #[test_async] -async fn test_tls() -> Result<(), TlsError> { +async fn test_tls() -> Result<()> { // Test the client against a server with CA intermediary cert chain // Requires X509VerifyFlags::PARTIAL_CHAIN or allow_partial: true (default) run_test( @@ -88,7 +87,7 @@ async fn test_tls() -> Result<(), TlsError> { Ok(()) } -async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), IoError> { +async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> { let addr = "127.0.0.1:19988".parse::().expect("parse"); let server_ft = async { @@ -135,7 +134,7 @@ async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), .expect("send failed"); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let client_ft = async { @@ -170,7 +169,7 @@ async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<(), assert_eq!(message, format!("message{}reply", i)); } - Ok(()) as Result<(), IoError> + Ok(()) as Result<()> }; let _ = zip(client_ft, server_ft).await; diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 84dfb19..9e31369 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -96,9 +96,7 @@ mod cert { } mod connector { - use std::io::Error as IoError; - use std::io::ErrorKind; - + use anyhow::{Context, Result}; use async_trait::async_trait; use futures_rustls::rustls::pki_types::ServerName; use tracing::debug; @@ -110,8 +108,6 @@ mod connector { use super::TlsConnector; - pub type TlsError = IoError; - /// connect as anonymous client #[derive(Clone)] pub struct TlsAnonymousConnector(TlsConnector); @@ -127,16 +123,11 @@ mod connector { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { let tcp_stream = stream(domain).await?; let fd = tcp_stream.as_connection_fd(); - let server_name = ServerName::try_from(domain).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("Invalid Dns Name: {}", err), - ) - })?; + let server_name = ServerName::try_from(domain).context("Invalid DNS name")?; let (write, read) = self .0 @@ -172,18 +163,14 @@ mod connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { debug!("connect to tls addr: {}", addr); let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); debug!("connect to tls domain: {}", self.domain); - let server_name = ServerName::try_from(self.domain.as_str()).map_err(|err| { - IoError::new( - ErrorKind::InvalidInput, - format!("Invalid Dns Name: {}", err), - ) - })?; + let server_name = + ServerName::try_from(self.domain.as_str()).context("Invalid DNS name")?; let (write, read) = self .connector From b6364a2f3805f6bccecdf8daed09a5f338ee8fc8 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 12:13:09 -0400 Subject: [PATCH 31/36] remove AllTcpStream --- src/net/mod.rs | 3 +-- src/openssl/mod.rs | 5 ++-- src/openssl/stream.rs | 56 ------------------------------------------- src/openssl/test.rs | 5 ++-- 4 files changed, 5 insertions(+), 64 deletions(-) diff --git a/src/net/mod.rs b/src/net/mod.rs index 30d9184..8ecf63a 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -129,8 +129,7 @@ mod wasm_connector { &self, addr: &str, ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { - let (mut _ws, wsstream) = WsMeta::connect(addr, None) - .await?; + let (mut _ws, wsstream) = WsMeta::connect(addr, None).await?; let wsstream_io = wsstream.into_io(); let (stream, sink) = wsstream_io.split(); Ok((Box::new(sink), Box::new(stream), String::from(addr))) diff --git a/src/openssl/mod.rs b/src/openssl/mod.rs index 1674b32..fd34b7b 100644 --- a/src/openssl/mod.rs +++ b/src/openssl/mod.rs @@ -14,20 +14,19 @@ pub use connector::{ certs, TlsAnonymousConnector, TlsConnector, TlsConnectorBuilder, TlsDomainConnector, }; pub use openssl::ssl::SslVerifyMode; -pub use stream::{AllTcpStream, TlsStream}; +pub use stream::TlsStream; pub type DefaultServerTlsStream = TlsStream; pub type DefaultClientTlsStream = TlsStream; mod split { - use async_net::TcpStream; use futures_util::AsyncReadExt; use super::*; use crate::net::{BoxReadConnection, BoxWriteConnection, SplitConnection}; - impl SplitConnection for TlsStream { + impl SplitConnection for TlsStream { fn split_connection(self) -> (BoxWriteConnection, BoxReadConnection) { let (read, write) = self.split(); (Box::new(write), Box::new(read)) diff --git a/src/openssl/stream.rs b/src/openssl/stream.rs index b976f02..28cd4fe 100644 --- a/src/openssl/stream.rs +++ b/src/openssl/stream.rs @@ -1,16 +1,12 @@ use std::fmt::Debug; use std::io; use std::io::Read; -use std::io::Result as IoResult; use std::io::Write; use std::pin::Pin; use std::task::{Context, Poll}; use futures_lite::{AsyncRead, AsyncWrite}; use openssl::ssl; -use pin_project::pin_project; - -use crate::net::TcpStream; use super::async_to_sync_wrapper::AsyncToSyncWrapper; use super::certificate::Certificate; @@ -73,55 +69,3 @@ fn result_to_poll(r: io::Result) -> Poll> { Err(e) => Poll::Ready(Err(e)), } } - -#[pin_project(project = EnumProj)] -pub enum AllTcpStream { - Tcp(#[pin] TcpStream), - Tls(#[pin] TlsStream), -} - -impl AllTcpStream { - pub fn tcp(stream: TcpStream) -> Self { - Self::Tcp(stream) - } - - pub fn tls(stream: TlsStream) -> Self { - Self::Tls(stream) - } -} - -impl AsyncRead for AllTcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_read(cx, buf), - EnumProj::Tls(stream) => stream.poll_read(cx, buf), - } - } -} - -impl AsyncWrite for AllTcpStream { - fn poll_write(self: Pin<&mut Self>, cx: &mut Context, buf: &[u8]) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_write(cx, buf), - EnumProj::Tls(stream) => stream.poll_write(cx, buf), - } - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_flush(cx), - EnumProj::Tls(stream) => stream.poll_flush(cx), - } - } - - fn poll_close(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - match self.project() { - EnumProj::Tcp(stream) => stream.poll_close(cx), - EnumProj::Tls(stream) => stream.poll_close(cx), - } - } -} diff --git a/src/openssl/test.rs b/src/openssl/test.rs index 2bc46eb..c3b614e 100644 --- a/src/openssl/test.rs +++ b/src/openssl/test.rs @@ -17,7 +17,7 @@ use crate::net::{tcp_stream::stream, TcpListener}; use crate::test_async; use crate::timer::sleep; -use super::{AllTcpStream, TlsAcceptor, TlsConnector}; +use super::{TlsAcceptor, TlsConnector}; const CA_PATH: &str = "certs/test-certs/ca.crt"; const INTERMEDIATE_CA_PATH: &str = "certs/test-certs/intermediate-ca.crt"; @@ -146,8 +146,7 @@ async fn run_test(acceptor: TlsAcceptor, connector: TlsConnector) -> Result<()> .connect("localhost", tcp_stream) .await .expect("tls failed"); - let all_stream = AllTcpStream::Tls(tls_stream); - let mut framed = Framed::new(all_stream.compat(), BytesCodec::new()); + let mut framed = Framed::new(tls_stream.compat(), BytesCodec::new()); debug!("client: got connection. waiting"); for i in 0..ITER { From 35c5f50ac329880cf7bd629672051d96f2820fff Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 12:55:02 -0400 Subject: [PATCH 32/36] revert trait error --- src/native_tls.rs | 21 ++++++++++++++++----- src/net/mod.rs | 16 +++++++++------- src/openssl/connector.rs | 20 ++++++++++++++++---- src/rust_tls.rs | 25 +++++++++++++++++++------ 4 files changed, 60 insertions(+), 22 deletions(-) diff --git a/src/native_tls.rs b/src/native_tls.rs index 572361a..c8300f4 100644 --- a/src/native_tls.rs +++ b/src/native_tls.rs @@ -29,9 +29,10 @@ mod split { } mod connector { + use std::io::Error as IoError; + use std::io::ErrorKind; use std::sync::Arc; - use anyhow::{Context, Result}; use async_trait::async_trait; use tracing::debug; @@ -58,14 +59,19 @@ mod connector { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { let tcp_stream = stream(domain).await?; let fd = tcp_stream.as_connection_fd(); let (write, read) = self .0 .connect(domain, tcp_stream) .await - .context("failed to connect")? + .map_err(|e| { + IoError::new( + ErrorKind::ConnectionRefused, + format!("failed to connect: {}", e), + ) + })? .split_connection(); Ok((write, read, fd)) } @@ -108,7 +114,7 @@ mod connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("connect to tls addr: {}", addr); let socket_opts = SocketOpts { keepalive: Some(Default::default()), @@ -122,7 +128,12 @@ mod connector { .connector .connect(&self.domain, tcp_stream) .await - .context("failed to connect")? + .map_err(|e| { + IoError::new( + ErrorKind::ConnectionRefused, + format!("failed to connect: {}", e), + ) + })? .split_connection(); Ok((write, read, fd)) } diff --git a/src/net/mod.rs b/src/net/mod.rs index 8ecf63a..1791d27 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -14,9 +14,9 @@ pub use wasm_connector::DefaultDomainWebsocketConnector as DefaultDomainConnecto mod conn { - use anyhow::Result; use async_trait::async_trait; use futures_lite::io::{AsyncRead, AsyncWrite}; + use std::io::Error as IoError; pub trait Connection: AsyncRead + AsyncWrite + Send + Sync + Unpin + SplitConnection {} impl Connection for T {} @@ -71,7 +71,7 @@ mod conn { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)>; + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError>; // create new version of my self with new domain fn new_domain(&self, domain: String) -> DomainConnector; @@ -111,9 +111,9 @@ pub mod certs { #[cfg(target_arch = "wasm32")] mod wasm_connector { use super::*; - use anyhow::Result; use async_trait::async_trait; use futures_util::io::AsyncReadExt; + use std::io::Error as IoError; use ws_stream_wasm::WsMeta; #[derive(Clone, Default)] @@ -128,8 +128,10 @@ mod wasm_connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { - let (mut _ws, wsstream) = WsMeta::connect(addr, None).await?; + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { + let (mut _ws, wsstream) = WsMeta::connect(addr, None) + .await + .map_err(|e| IoError::new(std::io::ErrorKind::Other, e))?; let wsstream_io = wsstream.into_io(); let (stream, sink) = wsstream_io.split(); Ok((Box::new(sink), Box::new(stream), String::from(addr))) @@ -147,8 +149,8 @@ mod wasm_connector { #[cfg(not(target_arch = "wasm32"))] mod unix_connector { - use anyhow::Result; use async_trait::async_trait; + use std::io::Error as IoError; use tracing::debug; use super::tcp_stream::stream; @@ -176,7 +178,7 @@ mod unix_connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("connect to tcp addr: {}", addr); let tcp_stream = stream(addr).await?; diff --git a/src/openssl/connector.rs b/src/openssl/connector.rs index c812161..22f6dca 100644 --- a/src/openssl/connector.rs +++ b/src/openssl/connector.rs @@ -1,4 +1,6 @@ use std::fmt; +use std::io::Error as IoError; +use std::io::ErrorKind; use std::path::Path; use anyhow::{Context, Result}; @@ -259,7 +261,7 @@ impl TcpDomainConnector for TlsAnonymousConnector { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("tcp connect: {}", domain); let socket_opts = SocketOpts { keepalive: Some(Default::default()), @@ -272,7 +274,12 @@ impl TcpDomainConnector for TlsAnonymousConnector { .0 .connect(domain, tcp_stream) .await - .map_err(|err| anyhow::anyhow!(err))? + .map_err(|e| { + IoError::new( + ErrorKind::ConnectionRefused, + format!("failed to connect: {}", e), + ) + })? .split_connection(); Ok((write, read, fd)) @@ -304,7 +311,7 @@ impl TcpDomainConnector for TlsDomainConnector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("connect to tls addr: {}", addr); let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); @@ -313,7 +320,12 @@ impl TcpDomainConnector for TlsDomainConnector { .connector .connect(&self.domain, tcp_stream) .await - .map_err(|err| anyhow::anyhow!(err))? + .map_err(|e| { + IoError::new( + ErrorKind::ConnectionRefused, + format!("failed to connect: {}", e), + ) + })? .split_connection(); debug!("connect to tls domain: {}", self.domain); diff --git a/src/rust_tls.rs b/src/rust_tls.rs index 9e31369..84dfb19 100644 --- a/src/rust_tls.rs +++ b/src/rust_tls.rs @@ -96,7 +96,9 @@ mod cert { } mod connector { - use anyhow::{Context, Result}; + use std::io::Error as IoError; + use std::io::ErrorKind; + use async_trait::async_trait; use futures_rustls::rustls::pki_types::ServerName; use tracing::debug; @@ -108,6 +110,8 @@ mod connector { use super::TlsConnector; + pub type TlsError = IoError; + /// connect as anonymous client #[derive(Clone)] pub struct TlsAnonymousConnector(TlsConnector); @@ -123,11 +127,16 @@ mod connector { async fn connect( &self, domain: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { let tcp_stream = stream(domain).await?; let fd = tcp_stream.as_connection_fd(); - let server_name = ServerName::try_from(domain).context("Invalid DNS name")?; + let server_name = ServerName::try_from(domain).map_err(|err| { + IoError::new( + ErrorKind::InvalidInput, + format!("Invalid Dns Name: {}", err), + ) + })?; let (write, read) = self .0 @@ -163,14 +172,18 @@ mod connector { async fn connect( &self, addr: &str, - ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd)> { + ) -> Result<(BoxWriteConnection, BoxReadConnection, ConnectionFd), IoError> { debug!("connect to tls addr: {}", addr); let tcp_stream = stream(addr).await?; let fd = tcp_stream.as_connection_fd(); debug!("connect to tls domain: {}", self.domain); - let server_name = - ServerName::try_from(self.domain.as_str()).context("Invalid DNS name")?; + let server_name = ServerName::try_from(self.domain.as_str()).map_err(|err| { + IoError::new( + ErrorKind::InvalidInput, + format!("Invalid Dns Name: {}", err), + ) + })?; let (write, read) = self .connector From a6662b98a4ab50fae272927d7efffc29c4eccfc2 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 13:31:05 -0400 Subject: [PATCH 33/36] retry deps --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a10aa0f..305c0cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ timer = ["async-io", "pin-project", "futures-lite", "fluvio-wasm-timer"] fs = ["async-fs", "futures-lite", "pin-utils", "async-trait"] zero_copy = ["nix", "task_unstable"] mmap = ["fs", "memmap2", "task_unstable"] -retry = ["cfg-if"] +retry = ["timer", "cfg-if", "async-trait", "futures-util/io"] doomsday = ["task", "sync"] tokio1 = ["async-std/tokio1"] attributes = [] From 942643e8fbf6cd87abde64db834d5d29adac713d Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 16:27:56 -0400 Subject: [PATCH 34/36] fix make target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 187e88b..b996d15 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ test-wasm-safari: install-wasm32 install-wasm-pack wasm-pack test --safari --headless test-derive: - cd async-test-derive; cargo test + cd fluvio-future-derive; cargo test check-wasm: install-wasm32 cargo build --target wasm32-unknown-unknown --all-features From f47741b83d56a80ad9b1ff74532356f6556c5bab Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 18:54:29 -0400 Subject: [PATCH 35/36] revert edition --- fluvio-future-derive/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluvio-future-derive/Cargo.toml b/fluvio-future-derive/Cargo.toml index 1dac70d..829aa56 100644 --- a/fluvio-future-derive/Cargo.toml +++ b/fluvio-future-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fluvio-future-derive" version = "0.1.0" -edition = "2021" +edition = "2018" authors = ["Fluvio Contributors "] description = "Procedure macro to run async fn as test" repository = "https://github.com/infinyon/future-aio" From 0fb03cbb64b37f8f5f12aa65dc074e8656032f77 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Fri, 12 Jul 2024 19:02:53 -0400 Subject: [PATCH 36/36] remove map_err --- src/openssl/connector.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openssl/connector.rs b/src/openssl/connector.rs index 22f6dca..4f7d21f 100644 --- a/src/openssl/connector.rs +++ b/src/openssl/connector.rs @@ -180,7 +180,6 @@ impl TlsConnector { AsyncToSyncWrapper::new(stream), ) .await - .map_err(|err| anyhow::anyhow!("oe {err}")) } }