From 2a55acd8133698728e957af9145aa4277915d3aa Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Fri, 9 Feb 2024 15:56:49 +0100 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=91=BD=EF=B8=8F=20Port=20to=20zbus=20?= =?UTF-8?q?4=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also implies bumping required versions of shared depdendencies, like event-listener and tokio. --- Cargo.lock | 604 +++++++++++++++++++++++------------------- Cargo.toml | 20 +- src/bus/mod.rs | 165 +++++++----- src/fdo/dbus.rs | 26 +- src/fdo/mod.rs | 5 +- src/fdo/monitoring.rs | 4 +- src/match_rules.rs | 17 +- src/peer/mod.rs | 12 +- src/peer/monitor.rs | 3 +- src/peer/stream.rs | 54 ++-- src/peers.rs | 47 ++-- tests/fdo.rs | 13 +- tests/greet.rs | 12 +- tests/monitor.rs | 9 +- 14 files changed, 529 insertions(+), 462 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e09a89a..2e71dcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -34,13 +43,14 @@ checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" [[package]] name = "async-broadcast" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b19760fa2b7301cf235360ffd6d3558b1ed4249edd16d6cca8d690cee265b95" +checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" dependencies = [ - "event-listener", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", "futures-core", - "parking_lot", + "pin-project-lite", ] [[package]] @@ -50,28 +60,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-io" -version = "1.13.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" dependencies = [ - "async-lock", - "autocfg", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", - "futures-lite", - "log", + "futures-io", + "futures-lite 2.2.0", "parking", "polling", "rustix", "slab", - "socket2", - "waker-fn", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -80,25 +102,36 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", ] [[package]] name = "async-process" -version = "1.7.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "15c1cd5d253ecac3d3cf15e390fd96bd92a13b1d14497d81abf077304794fb04" dependencies = [ + "async-channel 2.1.1", "async-io", - "async-lock", - "autocfg", + "async-lock 3.3.0", + "async-signal", "blocking", "cfg-if", - "event-listener", - "futures-lite", + "event-listener 4.0.3", + "futures-lite 2.2.0", "rustix", - "signal-hook", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -112,6 +145,24 @@ dependencies = [ "syn 1.0.103", ] +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io", + "async-lock 2.7.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + [[package]] name = "async-stream" version = "0.3.3" @@ -162,7 +213,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", "winapi", ] @@ -181,7 +232,7 @@ checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" dependencies = [ "async-trait", "axum-core", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-util", "http", @@ -218,6 +269,21 @@ dependencies = [ "tower-service", ] +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.7.1", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.1" @@ -230,6 +296,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + [[package]] name = "block-buffer" version = "0.10.3" @@ -245,12 +317,12 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ - "async-channel", - "async-lock", + "async-channel 1.8.0", + "async-lock 2.7.0", "async-task", "atomic-waker", - "fastrand", - "futures-lite", + "fastrand 1.8.0", + "futures-lite 1.13.0", "log", ] @@ -262,10 +334,10 @@ dependencies = [ "clap", "console-subscriber", "enumflags2", - "event-listener", + "event-listener 5.0.0", "futures-util", "hex", - "nix", + "nix 0.26.2", "ntest", "rand", "serde", @@ -290,9 +362,12 @@ checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -307,7 +382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", "once_cell", @@ -456,6 +531,12 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "enumflags2" version = "0.7.7" @@ -479,30 +560,61 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.1" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "event-listener" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ - "cc", - "libc", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +dependencies = [ + "event-listener 5.0.0", + "pin-project-lite", +] [[package]] name = "fastrand" @@ -513,6 +625,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + [[package]] name = "flate2" version = "1.0.25" @@ -520,7 +638,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -555,15 +673,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -571,7 +689,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.8.0", "futures-core", "futures-io", "memchr", @@ -580,6 +698,19 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -639,6 +770,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "h2" version = "0.3.15" @@ -692,12 +829,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - [[package]] name = "hex" version = "0.4.3" @@ -767,7 +898,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.4", "tokio", "tower-service", "tracing", @@ -805,17 +936,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "itertools" version = "0.10.5" @@ -839,25 +959,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "lock_api" -version = "0.4.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" @@ -898,6 +1008,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.16" @@ -919,16 +1038,24 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" -version = "0.8.4" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] @@ -937,14 +1064,26 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", - "memoffset", + "memoffset 0.7.1", "pin-utils", "static_assertions", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "libc", + "memoffset 0.9.0", +] + [[package]] name = "nom" version = "7.1.1" @@ -1003,10 +1142,19 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", ] +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.17.2" @@ -1031,32 +1179,9 @@ checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" [[package]] name = "parking" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys 0.36.1", -] +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "percent-encoding" @@ -1086,9 +1211,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1098,18 +1223,16 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "polling" -version = "2.8.0" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" dependencies = [ - "autocfg", - "bitflags", "cfg-if", "concurrent-queue", - "libc", - "log", "pin-project-lite", - "windows-sys 0.48.0", + "rustix", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -1240,7 +1363,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1278,18 +1401,23 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" -version = "0.37.3" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags", + "bitflags 2.4.2", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -1298,12 +1426,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - [[package]] name = "serde" version = "1.0.140" @@ -1366,16 +1488,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "signal-hook" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -1387,19 +1499,13 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - [[package]] name = "socket2" version = "0.4.4" @@ -1410,6 +1516,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -1457,7 +1573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", - "fastrand", + "fastrand 1.8.0", "libc", "redox_syscall", "remove_dir_all", @@ -1504,22 +1620,21 @@ dependencies = [ [[package]] name = "tokio" -version = "1.21.2" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", "tracing", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1534,13 +1649,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.22", ] [[package]] @@ -1635,7 +1750,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -1734,10 +1849,11 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "uds_windows" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ + "memoffset 0.9.0", "tempfile", "winapi", ] @@ -1813,28 +1929,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -1845,18 +1939,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -1875,10 +1963,19 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -1887,16 +1984,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -1905,16 +1996,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -1923,16 +2008,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -1941,16 +2020,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -1959,10 +2032,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -1971,22 +2044,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" +name = "windows_x86_64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "xdg-home" @@ -1994,29 +2067,27 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" dependencies = [ - "nix", + "nix 0.26.2", "winapi", ] [[package]] name = "zbus" -version = "3.14.1" -source = "git+https://github.com/dbus2/zbus/#79ad20b0af6468c6e892d6d647750e882b81ec9d" +version = "4.0.0" +source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e8353058abba" dependencies = [ "async-broadcast", "async-process", "async-recursion", "async-trait", - "byteorder", "derivative", "enumflags2", - "event-listener", + "event-listener 5.0.0", "futures-core", "futures-sink", "futures-util", "hex", - "nix", - "once_cell", + "nix 0.27.1", "ordered-stream", "rand", "serde", @@ -2026,7 +2097,7 @@ dependencies = [ "tokio", "tracing", "uds_windows", - "winapi", + "windows-sys 0.52.0", "xdg-home", "zbus_macros", "zbus_names", @@ -2035,8 +2106,8 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.14.1" -source = "git+https://github.com/dbus2/zbus/#79ad20b0af6468c6e892d6d647750e882b81ec9d" +version = "4.0.0" +source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e8353058abba" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2048,8 +2119,8 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.6.0" -source = "git+https://github.com/dbus2/zbus/#79ad20b0af6468c6e892d6d647750e882b81ec9d" +version = "3.0.0" +source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e8353058abba" dependencies = [ "serde", "static_assertions", @@ -2058,12 +2129,11 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.15.0" -source = "git+https://github.com/dbus2/zbus/#79ad20b0af6468c6e892d6d647750e882b81ec9d" +version = "4.0.0" +source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e8353058abba" dependencies = [ - "byteorder", + "endi", "enumflags2", - "libc", "serde", "static_assertions", "zvariant_derive", @@ -2071,8 +2141,8 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.0" -source = "git+https://github.com/dbus2/zbus/#79ad20b0af6468c6e892d6d647750e882b81ec9d" +version = "4.0.0" +source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e8353058abba" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2083,8 +2153,8 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "1.0.1" -source = "git+https://github.com/dbus2/zbus/#79ad20b0af6468c6e892d6d647750e882b81ec9d" +version = "1.1.0" +source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e8353058abba" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index bb8c8a4..ddebe5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,12 +20,22 @@ name = "busd" path = "src/bin/busd.rs" [dependencies] -zbus = { git = "https://github.com/dbus2/zbus/", features = ["tokio"], default-features = false } -#zbus = { version = "3.14.1", features = ["tokio"], default-features = false } -tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread", "signal", "tracing", "fs" ] } +zbus = { git = "https://github.com/dbus2/zbus/", features = ["tokio", "bus-impl"], default-features = false } +#zbus = { version = "4", features = ["tokio", "bus-impl"], default-features = false } +tokio = { version = "1.19.2", features = [ + "macros", + "rt-multi-thread", + "signal", + "tracing", + "fs", +] } clap = { version = "4.0.18", features = ["derive"] } tracing = "0.1.34" -tracing-subscriber = { version = "0.3.11", features = ["env-filter" , "fmt", "ansi"], default-features = false, optional = true } +tracing-subscriber = { version = "0.3.11", features = [ + "env-filter", + "fmt", + "ansi", +], default-features = false, optional = true } anyhow = "1.0.58" # Explicitly depend on serde to enable `rc` feature. serde = { version = "1.0.140", features = ["rc"] } @@ -36,7 +46,7 @@ console-subscriber = { version = "0.1.8", optional = true } hex = "0.4.3" xdg-home = "1.0.0" rand = "0.8.5" -event-listener = "2.5.3" +event-listener = "5" [target.'cfg(unix)'.dependencies] nix = "0.26.0" diff --git a/src/bus/mod.rs b/src/bus/mod.rs index 1c9c997..bc322d0 100644 --- a/src/bus/mod.rs +++ b/src/bus/mod.rs @@ -7,15 +7,18 @@ use futures_util::{ }; use std::{cell::OnceCell, str::FromStr, sync::Arc}; #[cfg(unix)] -use std::{ - env, - path::{Path, PathBuf}, -}; +use std::{env, path::Path}; #[cfg(unix)] use tokio::fs::remove_file; use tokio::{spawn, task::JoinHandle}; use tracing::{debug, info, trace, warn}; -use zbus::{Address, AuthMechanism, Connection, ConnectionBuilder, Guid, Socket, TcpAddress}; +#[cfg(unix)] +use zbus::address::transport::{Unix, UnixSocket}; +use zbus::{ + address::{transport::Tcp, Transport}, + connection::socket::BoxedSplit, + Address, AuthMechanism, Connection, ConnectionBuilder, Guid, OwnedGuid, +}; use crate::{ fdo::{self, DBus, Monitoring}, @@ -35,7 +38,7 @@ pub struct Bus { pub struct Inner { address: Address, peers: Arc, - guid: Arc, + guid: OwnedGuid, next_id: Option, auth_mechanism: AuthMechanism, self_conn: OnceCell, @@ -44,45 +47,38 @@ pub struct Inner { #[derive(Debug)] enum Listener { #[cfg(unix)] - Unix { - listener: tokio::net::UnixListener, - socket_path: PathBuf, - }, - Tcp { - listener: tokio::net::TcpListener, - }, + Unix(tokio::net::UnixListener), + Tcp(tokio::net::TcpListener), } impl Bus { pub async fn for_address(address: Option<&str>, auth_mechanism: AuthMechanism) -> Result { - let address = match address { - Some(address) => address.to_string(), - None => default_address(), + let mut address = match address { + Some(address) => Address::from_str(address)?, + None => Address::from_str(&default_address())?, }; - let address = Address::from_str(&address)?; - let listener = match &address { - #[cfg(unix)] - Address::Unix(path) => { - let path = Path::new(&path); - info!("Listening on {}.", path.display()); - - Self::unix_stream(path).await - } - Address::Tcp(address) => { - info!("Listening on `{}:{}`.", address.host(), address.port()); + let guid: OwnedGuid = match address.guid() { + Some(guid) => guid.to_owned().into(), + None => { + let guid = Guid::generate(); + address = address.set_guid(guid.clone())?; - Self::tcp_stream(address).await + guid.into() } - Address::NonceTcp { .. } => bail!("`nonce-tcp` transport is not supported (yet)."), - Address::Autolaunch(_) => bail!("`autolaunch` transport is not supported (yet)."), + }; + let listener = match address.transport() { + #[cfg(unix)] + Transport::Unix(unix) => Self::unix_stream(unix).await, + Transport::Tcp(tcp) => Self::tcp_stream(tcp).await, + #[cfg(windows)] + Transport::Autolaunch(_) => bail!("`autolaunch` transport is not supported (yet)."), _ => bail!("Unsupported address `{}`.", address), }?; - let mut bus = Self::new(address.clone(), listener, auth_mechanism).await?; + let mut bus = Self::new(address.clone(), guid.clone(), listener, auth_mechanism).await?; // Create a peer for ourselves. trace!("Creating self-dial connection."); - let guid = bus.guid().clone(); let dbus = DBus::new(bus.peers().clone(), guid.clone()); let monitoring = Monitoring::new(bus.peers().clone()); let conn_builder_fut = ConnectionBuilder::address(address)? @@ -114,17 +110,19 @@ impl Bus { // AsyncDrop would have been nice! pub async fn cleanup(self) -> Result<()> { - match self.listener { + match self.inner.address.transport() { #[cfg(unix)] - Listener::Unix { socket_path, .. } => { - remove_file(socket_path).await.map_err(Into::into) - } - Listener::Tcp { .. } => Ok(()), + Transport::Unix(unix) => match unix.path() { + UnixSocket::File(path) => remove_file(path).await.map_err(Into::into), + _ => Ok(()), + }, + _ => Ok(()), } } async fn new( address: Address, + guid: OwnedGuid, listener: Listener, auth_mechanism: AuthMechanism, ) -> Result { @@ -142,7 +140,7 @@ impl Bus { inner: Inner { address, peers: Peers::new(), - guid: Arc::new(Guid::generate()), + guid, next_id: None, auth_mechanism, self_conn: OnceCell::new(), @@ -151,23 +149,59 @@ impl Bus { } #[cfg(unix)] - async fn unix_stream(socket_path: &Path) -> Result { - let socket_path = socket_path.to_path_buf(); - let listener = Listener::Unix { - listener: tokio::net::UnixListener::bind(&socket_path)?, - socket_path, - }; + async fn unix_stream(unix: &Unix) -> Result { + // TODO: Use tokio::net::UnixListener directly once it supports abstract sockets: + // + // https://github.com/tokio-rs/tokio/issues/4610 + + use std::os::unix::net::SocketAddr; + + let addr = match unix.path() { + #[cfg(target_os = "linux")] + UnixSocket::Abstract(name) => { + use std::os::linux::net::SocketAddrExt; + + let addr = SocketAddr::from_abstract_name(name.as_encoded_bytes())?; + info!( + "Listening on abstract UNIX socket `{}`.", + name.to_string_lossy() + ); - Ok(listener) - } + addr + } + UnixSocket::File(path) => { + let addr = SocketAddr::from_pathname(path)?; + info!( + "Listening on UNIX socket file `{}`.", + path.to_string_lossy() + ); - async fn tcp_stream(address: &TcpAddress) -> Result { - let address = (address.host(), address.port()); - let listener = Listener::Tcp { - listener: tokio::net::TcpListener::bind(address).await?, + addr + } + UnixSocket::Dir(_) => bail!("`dir` transport is not supported (yet)."), + UnixSocket::TmpDir(_) => bail!("`tmpdir` transport is not supported (yet)."), + _ => bail!("Unsupported address."), }; + let std_listener = + tokio::task::spawn_blocking(move || std::os::unix::net::UnixListener::bind_addr(&addr)) + .await??; + std_listener.set_nonblocking(true)?; + tokio::net::UnixListener::from_std(std_listener) + .map(Listener::Unix) + .map_err(Into::into) + } + + async fn tcp_stream(tcp: &Tcp) -> Result { + if tcp.nonce_file().is_some() { + bail!("`nonce-tcp` transport is not supported (yet)."); + } + info!("Listening on `{}:{}`.", tcp.host(), tcp.port()); + let address = (tcp.host(), tcp.port()); - Ok(listener) + tokio::net::TcpListener::bind(address) + .await + .map(Listener::Tcp) + .map_err(Into::into) } async fn accept_next(&mut self) -> Result<()> { @@ -203,35 +237,22 @@ impl Bus { Ok(()) } - async fn accept(&mut self) -> Result> { - match &mut self.listener { + async fn accept(&mut self) -> Result { + let stream = match &mut self.listener { #[cfg(unix)] - Listener::Unix { - listener, - socket_path, - } => { - let (unix_stream, _) = listener.accept().await?; - debug!( - "Accepted connection on socket file {}", - socket_path.display() - ); - - Ok(Box::new(unix_stream)) - } - Listener::Tcp { listener } => { - let (tcp_stream, addr) = listener.accept().await?; - debug!("Accepted connection from {addr}"); + Listener::Unix(listener) => listener.accept().await.map(|(stream, _)| stream.into())?, + Listener::Tcp(listener) => listener.accept().await.map(|(stream, _)| stream.into())?, + }; + debug!("Accepted connection on address `{}`", self.inner.address); - Ok(Box::new(tcp_stream)) - } - } + Ok(stream) } pub fn peers(&self) -> &Arc { &self.inner.peers } - pub fn guid(&self) -> &Arc { + pub fn guid(&self) -> &OwnedGuid { &self.inner.guid } diff --git a/src/fdo/dbus.rs b/src/fdo/dbus.rs index 4e4cfc4..0c288e2 100644 --- a/src/fdo/dbus.rs +++ b/src/fdo/dbus.rs @@ -7,13 +7,13 @@ use enumflags2::BitFlags; use tokio::spawn; use tracing::warn; use zbus::{ - dbus_interface, fdo::{ ConnectionCredentials, Error, ReleaseNameReply, RequestNameFlags, RequestNameReply, Result, }, + interface, names::{BusName, InterfaceName, OwnedBusName, OwnedUniqueName, UniqueName, WellKnownName}, zvariant::Optional, - Guid, MessageHeader, OwnedMatchRule, ResponseDispatchNotifier, SignalContext, + MessageHeader, OwnedGuid, OwnedMatchRule, ResponseDispatchNotifier, SignalContext, }; use super::msg_sender; @@ -22,14 +22,14 @@ use crate::{peer::Peer, peers::Peers}; #[derive(Debug)] pub struct DBus { peers: Weak, - guid: Arc, + guid: OwnedGuid, } impl DBus { pub const PATH: &'static str = "/org/freedesktop/DBus"; pub const INTERFACE: &'static str = "org.freedesktop.DBus"; - pub fn new(peers: Arc, guid: Arc) -> Self { + pub fn new(peers: Arc, guid: OwnedGuid) -> Self { Self { peers: Arc::downgrade(&peers), guid, @@ -59,7 +59,7 @@ impl DBus { } } -#[dbus_interface(interface = "org.freedesktop.DBus")] +#[interface(interface = "org.freedesktop.DBus")] impl DBus { /// This is already called & handled and we only need to handle it once. async fn hello( @@ -224,7 +224,7 @@ impl DBus { } /// Returns the security context used by SELinux, in an unspecified format. - #[dbus_interface(name = "GetConnectionSELinuxSecurityContext")] + #[zbus(name = "GetConnectionSELinuxSecurityContext")] async fn get_connection_selinux_security_context( &self, bus_name: BusName<'_>, @@ -239,7 +239,7 @@ impl DBus { } /// Returns the Unix process ID of the process connected to the server. - #[dbus_interface(name = "GetConnectionUnixProcessID")] + #[zbus(name = "GetConnectionUnixProcessID")] async fn get_connection_unix_process_id(&self, bus_name: BusName<'_>) -> Result { self.get_connection_credentials(bus_name.clone()) .await @@ -264,7 +264,7 @@ impl DBus { } /// Gets the unique ID of the bus. - fn get_id(&self) -> &Guid { + fn get_id(&self) -> &OwnedGuid { &self.guid } @@ -356,7 +356,7 @@ impl DBus { /// This property lists abstract “features” provided by the message bus, and can be used by /// clients to detect the capabilities of the message bus with which they are communicating. - #[dbus_interface(property)] + #[zbus(property)] fn features(&self) -> &[&str] { &[] } @@ -373,7 +373,7 @@ impl DBus { /// `org.freedesktop.DBus` was successful. The standard `org.freedesktop.DBus.Peer` and /// `org.freedesktop.DBus.Introspectable` interfaces are not included in the value of this /// property either, because they do not indicate features of the message bus implementation. - #[dbus_interface(property)] + #[zbus(property)] fn interfaces(&self) -> &[InterfaceName<'_>] { // TODO: List `org.freedesktop.DBus.Monitoring` when we support it. &[] @@ -382,7 +382,7 @@ impl DBus { /// This signal indicates that the owner of a name has changed. /// /// It's also the signal to use to detect the appearance of new names on the bus. - #[dbus_interface(signal)] + #[zbus(signal)] pub async fn name_owner_changed( signal_ctxt: &SignalContext<'_>, name: BusName<'_>, @@ -391,11 +391,11 @@ impl DBus { ) -> zbus::Result<()>; /// This signal is sent to a specific application when it loses ownership of a name. - #[dbus_interface(signal)] + #[zbus(signal)] pub async fn name_lost(signal_ctxt: &SignalContext<'_>, name: BusName<'_>) -> zbus::Result<()>; /// This signal is sent to a specific application when it gains ownership of a name. - #[dbus_interface(signal)] + #[zbus(signal)] pub async fn name_acquired( signal_ctxt: &SignalContext<'_>, name: BusName<'_>, diff --git a/src/fdo/mod.rs b/src/fdo/mod.rs index c6d14f1..446cae7 100644 --- a/src/fdo/mod.rs +++ b/src/fdo/mod.rs @@ -9,8 +9,5 @@ pub const BUS_NAME: &str = "org.freedesktop.DBus"; /// Helper for getting the peer name from a message header. fn msg_sender<'h>(hdr: &'h MessageHeader<'h>) -> &'h UniqueName<'h> { // SAFETY: The bus (that's us!) is supposed to ensure a valid sender on the message. - hdr.sender() - .ok() - .flatten() - .expect("Missing `sender` header") + hdr.sender().expect("Missing `sender` header") } diff --git a/src/fdo/monitoring.rs b/src/fdo/monitoring.rs index 98f449f..d9cfad0 100644 --- a/src/fdo/monitoring.rs +++ b/src/fdo/monitoring.rs @@ -3,8 +3,8 @@ use std::sync::{Arc, Weak}; use tokio::spawn; use tracing::{debug, warn}; use zbus::{ - dbus_interface, fdo::{Error, Result}, + interface, zvariant::Optional, MessageHeader, ResponseDispatchNotifier, SignalContext, }; @@ -28,7 +28,7 @@ impl Monitoring { } } -#[dbus_interface(interface = "org.freedesktop.DBus.Monitoring")] +#[interface(interface = "org.freedesktop.DBus.Monitoring")] impl Monitoring { async fn become_monitor( &self, diff --git a/src/match_rules.rs b/src/match_rules.rs index 970fd69..1d7736a 100644 --- a/src/match_rules.rs +++ b/src/match_rules.rs @@ -16,7 +16,7 @@ impl MatchRules { /// /// if header, SENDER or DESTINATION is not set. pub fn matches(&self, msg: &zbus::Message, name_registry: &NameRegistry) -> bool { - let hdr = msg.header().expect("received message without header"); + let hdr = msg.header(); let ret = self.0.iter().any(|rule| { // First make use of zbus API @@ -36,25 +36,14 @@ impl MatchRules { // Unique name is already taken care of by the zbus API. BusName::Unique(_) => None, }) { - if sender - != hdr - .sender() - .expect("SENDER field unset") - .expect("SENDER field unset") - .clone() - { + if sender != hdr.sender().expect("SENDER field unset").clone() { return false; } } // The destination. if let Some(destination) = rule.destination() { - match hdr - .destination() - .expect("DESTINATION field unset") - .expect("DESTINATION field unset") - .clone() - { + match hdr.destination().expect("DESTINATION field unset").clone() { BusName::WellKnown(name) => match name_registry.lookup(name) { Some(name) if name == *destination => (), Some(_) => return false, diff --git a/src/peer/mod.rs b/src/peer/mod.rs index 28dc18f..d9ae1f1 100644 --- a/src/peer/mod.rs +++ b/src/peer/mod.rs @@ -4,13 +4,11 @@ pub use stream::*; mod monitor; pub use monitor::*; -use std::sync::Arc; - use anyhow::Result; use tracing::trace; use zbus::{ - names::OwnedUniqueName, AuthMechanism, Connection, ConnectionBuilder, Guid, OwnedMatchRule, - Socket, + connection::socket::BoxedSplit, names::OwnedUniqueName, AuthMechanism, Connection, + ConnectionBuilder, OwnedGuid, OwnedMatchRule, }; use crate::{fdo, match_rules::MatchRules, name_registry::NameRegistry}; @@ -27,9 +25,9 @@ pub struct Peer { impl Peer { pub async fn new( - guid: Arc, + guid: OwnedGuid, id: Option, - socket: Box, + socket: BoxedSplit, auth_mechanism: AuthMechanism, ) -> Result { let unique_name = match id { @@ -37,7 +35,7 @@ impl Peer { None => OwnedUniqueName::try_from(fdo::BUS_NAME).unwrap(), }; let conn = ConnectionBuilder::socket(socket) - .server(&guid) + .server(guid)? .p2p() .auth_mechanisms(&[auth_mechanism]) .build() diff --git a/src/peer/monitor.rs b/src/peer/monitor.rs index eeadcf1..7777ea6 100644 --- a/src/peer/monitor.rs +++ b/src/peer/monitor.rs @@ -33,8 +33,7 @@ impl Monitor { /// Same as [`MatchRules::matches`]. pub fn interested(&self, msg: &zbus::Message, name_registry: &NameRegistry) -> bool { if self.match_rules.is_empty() - || msg.header().unwrap().destination().unwrap() - == Some(&BusName::from(self.unique_name.clone())) + || msg.header().destination().unwrap() == &BusName::from(&self.unique_name) { return true; } diff --git a/src/peer/stream.rs b/src/peer/stream.rs index f211f0b..926ff27 100644 --- a/src/peer/stream.rs +++ b/src/peer/stream.rs @@ -1,14 +1,9 @@ -#[cfg(unix)] -use std::os::fd::AsRawFd; -use std::{pin::Pin, sync::Arc}; +use std::pin::Pin; use anyhow::{bail, Error, Result}; use futures_util::{Stream as FutureStream, TryStream, TryStreamExt}; use tracing::trace; -use zbus::{ - zvariant::Type, Message, MessageBuilder, MessageField, MessageFieldCode, MessageStream, - MessageType, -}; +use zbus::{zvariant::Type, Message, MessageBuilder, MessageStream, MessageType}; use crate::peer::Peer; @@ -22,8 +17,7 @@ pub struct Stream { stream: Pin>, } -type StreamInner = - dyn TryStream, Error = Error, Item = Result>> + Send; +type StreamInner = dyn TryStream> + Send; impl Stream { pub fn for_peer(peer: &Peer) -> Self { @@ -33,37 +27,31 @@ impl Stream { .and_then(move |msg| { let unique_name = unique_name.clone(); async move { - let fields = match msg.message_type() { - MessageType::MethodCall - | MessageType::MethodReturn - | MessageType::Error - | MessageType::Signal => msg.fields()?, - MessageType::Invalid => bail!("Invalid message"), - }; + let header = msg.header(); // Ensure destination field is present and readable for non-signals. - if msg.message_type() != MessageType::Signal { - match fields.get_field(MessageFieldCode::Destination) { - Some(MessageField::Destination(_)) => (), - Some(_) => { - bail!("failed to parse message: Invalid destination field"); - } - None => bail!("missing destination field"), - } + if msg.message_type() != MessageType::Signal && header.destination().is_none() { + bail!("missing destination field"); } // Ensure sender field is present. If it is not we add it using the unique name // of the peer. - match fields.get_field(MessageFieldCode::Sender) { - Some(MessageField::Sender(sender)) if *sender == unique_name => Ok(msg), + match header.sender() { + Some(sender) if *sender == unique_name => Ok(msg), Some(_) => bail!("failed to parse message: Invalid sender field"), None => { - let header = msg.header()?; - let signature = match header.signature()? { + let signature = match header.signature() { Some(sig) => sig.clone(), None => <()>::signature(), }; - let body_bytes = msg.body_as_bytes()?; + let body = msg.body(); + let body_bytes = body.data(); + #[cfg(unix)] + let fds = body_bytes + .fds() + .iter() + .map(|fd| fd.try_clone().map(Into::into)) + .collect::>>()?; let builder = MessageBuilder::from(header.clone()).sender(&unique_name)?; let new_msg = unsafe { @@ -71,12 +59,12 @@ impl Stream { body_bytes, signature, #[cfg(unix)] - msg.take_fds().iter().map(|fd| fd.as_raw_fd()).collect(), + fds, )? }; trace!("Added sender field to message: {:?}", new_msg); - Ok(Arc::new(new_msg)) + Ok(new_msg) } } } @@ -89,12 +77,12 @@ impl Stream { } impl FutureStream for Stream { - type Item = Result>; + type Item = Result; fn poll_next( self: Pin<&mut Self>, cx: &mut std::task::Context, - ) -> std::task::Poll>>> { + ) -> std::task::Poll>> { FutureStream::poll_next(Pin::new(&mut self.get_mut().stream), cx) } } diff --git a/src/peers.rs b/src/peers.rs index d8db73b..156682c 100644 --- a/src/peers.rs +++ b/src/peers.rs @@ -3,7 +3,6 @@ use event_listener::EventListener; use futures_util::{ future::{select, Either}, stream::StreamExt, - SinkExt, }; use std::{ collections::BTreeMap, @@ -13,9 +12,10 @@ use std::{ use tokio::{spawn, sync::RwLock}; use tracing::{debug, trace, warn}; use zbus::{ + connection::socket::BoxedSplit, names::{BusName, OwnedUniqueName, UniqueName}, zvariant::Optional, - AuthMechanism, Guid, MessageBuilder, MessageField, MessageFieldCode, MessageType, Socket, + AuthMechanism, Message, MessageType, OwnedGuid, }; use crate::{ @@ -45,9 +45,9 @@ impl Peers { pub async fn add( self: &Arc, - guid: &Arc, + guid: &OwnedGuid, id: Option, - socket: Box, + socket: BoxedSplit, auth_mechanism: AuthMechanism, ) -> Result<()> { let mut peers = self.peers_mut().await; @@ -128,7 +128,7 @@ impl Peers { let new_owner = name_owner_changed.new_owner.map(UniqueName::from); // First broadcast the name change signal. - let msg = MessageBuilder::signal(fdo::DBus::PATH, fdo::DBus::INTERFACE, "NameOwnerChanged") + let msg = Message::signal(fdo::DBus::PATH, fdo::DBus::INTERFACE, "NameOwnerChanged") .unwrap() .sender(fdo::BUS_NAME) .unwrap() @@ -137,36 +137,30 @@ impl Peers { Optional::from(old_owner.clone()), Optional::from(new_owner.clone()), ))?; - self.broadcast_msg(Arc::new(msg)).await; + self.broadcast_msg(msg).await; // Now unicast the appropriate signal to the old and new owners. if let Some(old_owner) = old_owner { - let msg = MessageBuilder::signal(fdo::DBus::PATH, fdo::DBus::INTERFACE, "NameLost") + let msg = Message::signal(fdo::DBus::PATH, fdo::DBus::INTERFACE, "NameLost") .unwrap() .sender(fdo::BUS_NAME) .unwrap() .destination(old_owner.clone()) .unwrap() .build(&name)?; - if let Err(e) = self - .send_msg_to_unique_name(Arc::new(msg), old_owner.clone()) - .await - { + if let Err(e) = self.send_msg_to_unique_name(msg, old_owner.clone()).await { warn!("Couldn't notify inexistant peer {old_owner} about loosing name {name}: {e}") } } if let Some(new_owner) = new_owner { - let msg = MessageBuilder::signal(fdo::DBus::PATH, fdo::DBus::INTERFACE, "NameAcquired") + let msg = Message::signal(fdo::DBus::PATH, fdo::DBus::INTERFACE, "NameAcquired") .unwrap() .sender(fdo::BUS_NAME) .unwrap() .destination(new_owner.clone()) .unwrap() .build(&name)?; - if let Err(e) = self - .send_msg_to_unique_name(Arc::new(msg), new_owner.clone()) - .await - { + if let Err(e) = self.send_msg_to_unique_name(msg, new_owner.clone()).await { warn!("Couldn't notify peer {new_owner} about acquiring name {name}: {e}") } } @@ -203,8 +197,8 @@ impl Peers { match msg.message_type() { MessageType::Signal => self.broadcast_msg(msg).await, - _ => match msg.fields()?.get_field(MessageFieldCode::Destination) { - Some(MessageField::Destination(dest)) => { + _ => match msg.header().destination() { + Some(dest) => { if let Err(e) = self.send_msg(msg.clone(), dest.clone()).await { warn!("{}", e); } @@ -239,7 +233,7 @@ impl Peers { Ok(()) } - async fn send_msg(&self, msg: Arc, destination: BusName<'_>) -> Result<()> { + async fn send_msg(&self, msg: Message, destination: BusName<'_>) -> Result<()> { trace!( "Forwarding message: {:?}, destination: {}", msg, @@ -259,7 +253,7 @@ impl Peers { async fn send_msg_to_unique_name( &self, - msg: Arc, + msg: Message, destination: UniqueName<'_>, ) -> Result<()> { let conn = self @@ -269,10 +263,7 @@ impl Peers { .get(destination.as_str()) .map(|peer| peer.conn().clone()); match conn { - Some(mut conn) => conn - .send(msg.clone()) - .await - .context("failed to send message")?, + Some(conn) => conn.send(&msg).await.context("failed to send message")?, None => debug!("no peer for destination `{destination}`"), } let name_registry = self.name_registry().await; @@ -281,7 +272,7 @@ impl Peers { Ok(()) } - async fn broadcast_msg(&self, msg: Arc) { + async fn broadcast_msg(&self, msg: Message) { trace!("Broadcasting message: {:?}", msg); let name_registry = self.name_registry().await; for peer in self.peers.read().await.values() { @@ -292,7 +283,7 @@ impl Peers { if let Err(e) = peer .conn() - .send(msg.clone()) + .send(&msg) .await .context("failed to send message") { @@ -303,7 +294,7 @@ impl Peers { self.broadcast_to_monitors(msg, &name_registry).await; } - async fn broadcast_to_monitors(&self, msg: Arc, name_registry: &NameRegistry) { + async fn broadcast_to_monitors(&self, msg: Message, name_registry: &NameRegistry) { let monitors = self.monitors.read().await; if monitors.is_empty() { return; @@ -324,7 +315,7 @@ impl Peers { if let Err(e) = monitor .conn() - .send(msg.clone()) + .send(&msg) .await .context("failed to send message") { diff --git a/tests/fdo.rs b/tests/fdo.rs index be35b11..534b03b 100644 --- a/tests/fdo.rs +++ b/tests/fdo.rs @@ -101,7 +101,7 @@ async fn name_ownership_changes_client(address: &str, tx: Sender<()>) -> anyhow: "expected new owner to be us" ); ensure!( - changed.header()?.destination()?.is_none(), + changed.message().header().destination().is_none(), "expected no destination for our signal", ); let acquired = name_acquired_stream.next().await.unwrap(); @@ -110,7 +110,8 @@ async fn name_ownership_changes_client(address: &str, tx: Sender<()>) -> anyhow: "expected name acquired signal for our name" ); ensure!( - *acquired.header()?.destination()?.unwrap() == BusName::from(conn.unique_name().unwrap()), + *acquired.message().header().destination().unwrap() + == BusName::from(conn.unique_name().unwrap()), "expected name acquired signal to be unicasted to the acquiring connection", ); @@ -185,7 +186,7 @@ async fn name_ownership_changes_client(address: &str, tx: Sender<()>) -> anyhow: "expected new owner to be our second connection" ); ensure!( - changed.header()?.destination()?.is_none(), + changed.message().header().destination().is_none(), "expected no destination for our signal", ); let lost = name_lost_stream.next().await.unwrap(); @@ -194,7 +195,8 @@ async fn name_ownership_changes_client(address: &str, tx: Sender<()>) -> anyhow: "expected name lost signal for our name" ); ensure!( - *lost.header()?.destination()?.unwrap() == BusName::from(conn.unique_name().unwrap()), + *lost.message().header().destination().unwrap() + == BusName::from(conn.unique_name().unwrap()), "expected name lost signal to be unicasted to the loosing connection", ); let acquired = name_acquired_stream.next().await.unwrap(); @@ -203,7 +205,8 @@ async fn name_ownership_changes_client(address: &str, tx: Sender<()>) -> anyhow: "expected name acquired signal for our name" ); ensure!( - *acquired.header()?.destination()?.unwrap() == BusName::from(conn2.unique_name().unwrap()), + *acquired.message().header().destination().unwrap() + == BusName::from(conn2.unique_name().unwrap()), "expected name acquired signal to be unicasted to the acquiring connection", ); diff --git a/tests/greet.rs b/tests/greet.rs index 51ca8b0..52c4ab1 100644 --- a/tests/greet.rs +++ b/tests/greet.rs @@ -11,8 +11,8 @@ use rand::{ use tokio::{select, sync::mpsc::channel, time::timeout}; use tracing::instrument; use zbus::{ - dbus_interface, dbus_proxy, fdo::{self, DBusProxy}, + interface, proxy, zvariant::ObjectPath, AsyncDrop, AuthMechanism, CacheProperties, Connection, ConnectionBuilder, MatchRule, MessageHeader, MessageStream, SignalContext, @@ -73,7 +73,7 @@ async fn greet_service(socket_addr: &str) -> anyhow::Result { count: u64, } - #[dbus_interface(name = "org.zbus.MyGreeter1")] + #[interface(name = "org.zbus.MyGreeter1")] impl Greeter { async fn say_hello( &mut self, @@ -82,7 +82,7 @@ async fn greet_service(socket_addr: &str) -> anyhow::Result { #[zbus(header)] header: MessageHeader<'_>, ) -> fdo::Result { self.count += 1; - let path = header.path()?.unwrap().clone(); + let path = header.path().unwrap().clone(); Self::greeted(&ctxt, name, self.count, path).await?; Ok(format!( "Hello {}! I have been called {} times.", @@ -90,7 +90,7 @@ async fn greet_service(socket_addr: &str) -> anyhow::Result { )) } - #[dbus_interface(signal)] + #[zbus(signal)] async fn greeted( ctxt: &SignalContext<'_>, name: &str, @@ -110,14 +110,14 @@ async fn greet_service(socket_addr: &str) -> anyhow::Result { #[instrument] async fn greet_client(socket_addr: &str) -> anyhow::Result<()> { - #[dbus_proxy( + #[proxy( interface = "org.zbus.MyGreeter1", default_path = "/org/zbus/MyGreeter" )] trait MyGreeter { fn say_hello(&self, name: &str) -> zbus::Result; - #[dbus_proxy(signal)] + #[zbus(signal)] async fn greeted(name: &str, count: u64, path: ObjectPath<'_>); } diff --git a/tests/monitor.rs b/tests/monitor.rs index 4a38723..45f9ad0 100644 --- a/tests/monitor.rs +++ b/tests/monitor.rs @@ -95,20 +95,21 @@ async fn become_monitor_client(address: &str, tx: Sender<()>) -> anyhow::Result< let mut request_name_serial = None; while num_received < 8 { let msg = msg_stream.try_next().await?.unwrap(); - let member = msg.member(); + let header = msg.header(); + let member = header.member(); match msg.message_type() { MessageType::MethodCall => match member.unwrap().as_str() { "Hello" => { - hello_serial = msg.primary_header().serial_num().cloned(); + hello_serial = Some(msg.primary_header().serial_num()); } "RequestName" => { - request_name_serial = msg.primary_header().serial_num().cloned(); + request_name_serial = Some(msg.primary_header().serial_num()); } method => panic!("unexpected method call: {}", method), }, MessageType::MethodReturn => { - let serial = msg.reply_serial(); + let serial = header.reply_serial(); if serial == hello_serial { hello_serial = None; } else if serial == request_name_serial { From 2023aecb769bcaaa21a3bf63dcafe41903d268c1 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sat, 10 Feb 2024 20:06:14 +0100 Subject: [PATCH 2/8] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=20Bump=20MSRV=20to=20?= =?UTF-8?q?1.74?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` error: current MSRV (Minimum Supported Rust Version) is `1.70.0` but this item is stable since `1.74.0` --> src/bus/mod.rs:163:64 | 163 | let addr = SocketAddr::from_abstract_name(name.as_encoded_bytes())?; | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv = note: `-D clippy::incompatible-msrv` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]` ``` --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ddebe5d..5adc3fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ description = "A D-Bus bus (broker) implementation" edition = "2021" license = "MIT" readme = "README.md" -rust-version = "1.70" +rust-version = "1.74" repository = "https://github.com/dbus2/busd" keywords = ["D-Bus", "DBus", "IPC"] categories = ["network-programming"] From 8d74956c3668a243845c2c4e7ad26db773e366b5 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sat, 10 Feb 2024 20:10:06 +0100 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=9A=A8=20Implement=20Display=20for=20?= =?UTF-8?q?Cookie=20instead=20of=20ToString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` error: direct implementation of `ToString` --> src/bus/cookies.rs:222:1 | 222 | / impl ToString for Cookie { 223 | | fn to_string(&self) -> String { 224 | | format!("{} {} {}", self.id, self.created, self.cookie) 225 | | } 226 | | } | |_^ | = help: prefer implementing `Display` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl = note: `-D clippy::to-string-trait-impl` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::to_string_trait_impl)]` ``` --- src/bus/cookies.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bus/cookies.rs b/src/bus/cookies.rs index d602dcc..ca6f2ba 100644 --- a/src/bus/cookies.rs +++ b/src/bus/cookies.rs @@ -1,13 +1,14 @@ use anyhow::{anyhow, Error, Result}; use rand::Rng; -#[cfg(unix)] -use std::{fs::Permissions, os::unix::prelude::PermissionsExt}; use std::{ + fmt::{self, Display, Formatter}, io, str::FromStr, time::{Duration, SystemTime, UNIX_EPOCH}, }; #[cfg(unix)] +use std::{fs::Permissions, os::unix::prelude::PermissionsExt}; +#[cfg(unix)] use tokio::fs::set_permissions; use tokio::{ fs::{create_dir_all, metadata, remove_file, rename, File, OpenOptions}, @@ -219,9 +220,9 @@ impl FromStr for Cookie { } } -impl ToString for Cookie { - fn to_string(&self) -> String { - format!("{} {} {}", self.id, self.created, self.cookie) +impl Display for Cookie { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + write!(f, "{} {} {}", self.id, self.created, self.cookie) } } From 26a90775f881cdade2ce99621eb3d5caaf867437 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sat, 10 Feb 2024 21:32:15 +0100 Subject: [PATCH 4/8] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=20Update=20dependenci?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 944 ++++++++++++++++++++++++----------------------------- 1 file changed, 420 insertions(+), 524 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e71dcf..f893ee4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,27 +19,66 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "anstream" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ - "winapi", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.58" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "async-broadcast" @@ -55,24 +94,13 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", ] @@ -87,7 +115,7 @@ dependencies = [ "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite", "parking", "polling", "rustix", @@ -98,9 +126,9 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener 2.5.3", ] @@ -122,27 +150,27 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c1cd5d253ecac3d3cf15e390fd96bd92a13b1d14497d81abf077304794fb04" dependencies = [ - "async-channel 2.1.1", + "async-channel", "async-io", "async-lock 3.3.0", "async-signal", "blocking", "cfg-if", "event-listener 4.0.3", - "futures-lite 2.2.0", + "futures-lite", "rustix", "windows-sys 0.52.0", ] [[package]] name = "async-recursion" -version = "1.0.0" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cda8f4bcc10624c4e85bc66b3f452cca98cfa5ca002dc83a16aad2367641bea" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] @@ -152,7 +180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ "async-io", - "async-lock 2.7.0", + "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", @@ -163,60 +191,28 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "async-stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.103", -] - [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] name = "atomic-waker" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" - -[[package]] -name = "atty" -version = "0.2.14" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" @@ -226,9 +222,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.5.17" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", "axum-core", @@ -244,20 +240,19 @@ dependencies = [ "mime", "percent-encoding", "pin-project-lite", + "rustversion", "serde", "sync_wrapper", - "tokio", "tower", - "tower-http", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.2.9" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", "bytes", @@ -265,6 +260,7 @@ dependencies = [ "http", "http-body", "mime", + "rustversion", "tower-layer", "tower-service", ] @@ -279,16 +275,16 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide 0.7.1", + "miniz_oxide", "object", "rustc-demangle", ] [[package]] name = "base64" -version = "0.13.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -304,26 +300,27 @@ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] name = "blocking" -version = "1.3.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 1.8.0", - "async-lock 2.7.0", + "async-channel", + "async-lock 3.3.0", "async-task", - "atomic-waker", - "fastrand 1.8.0", - "futures-lite 1.13.0", - "log", + "fastrand", + "futures-io", + "futures-lite", + "piper", + "tracing", ] [[package]] @@ -337,7 +334,7 @@ dependencies = [ "event-listener 5.0.0", "futures-util", "hex", - "nix 0.26.2", + "nix 0.26.4", "ntest", "rand", "serde", @@ -350,15 +347,15 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.2.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" @@ -377,55 +374,64 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.0.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ - "atty", - "bitflags 1.3.2", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "once_cell", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] [[package]] name = "console-api" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57ff02e8ad8e06ab9731d5dc72dc23bef9200778eae1a89d555d8c42e5d4a86" +checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" dependencies = [ "prost", "prost-types", @@ -435,9 +441,9 @@ dependencies = [ [[package]] name = "console-subscriber" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a3a81dfaf6b66bce5d159eddae701e3a002f194d378cbf7be5f053c281d9be" +checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" dependencies = [ "console-api", "crossbeam-channel", @@ -459,9 +465,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -477,22 +483,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -512,14 +514,14 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -527,9 +529,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "endi" @@ -539,9 +541,9 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", "serde", @@ -549,15 +551,21 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.48", ] +[[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.8" @@ -616,15 +624,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.1" @@ -633,12 +632,12 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] @@ -649,9 +648,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -663,9 +662,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -683,28 +682,13 @@ 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.8.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 2.0.1", + "fastrand", "futures-core", "futures-io", "parking", @@ -713,32 +697,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-macro", @@ -751,9 +735,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -761,9 +745,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -778,9 +762,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.15" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -788,7 +772,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 2.2.2", "slab", "tokio", "tokio-util", @@ -801,11 +785,17 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ "base64", "byteorder", @@ -816,18 +806,15 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -837,9 +824,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -848,21 +835,15 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" version = "1.8.0" @@ -871,9 +852,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -883,9 +864,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.22" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfba89e19b959ca163c7752ba59d737c1ceea53a5d31a149c805446fc958064" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -898,7 +879,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.4", + "socket2", "tokio", "tower-service", "tracing", @@ -919,21 +900,22 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] -name = "instant" -version = "0.1.12" +name = "indexmap" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ - "cfg-if", + "equivalent", + "hashbrown 0.14.3", ] [[package]] @@ -947,9 +929,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "lazy_static" @@ -959,9 +941,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" @@ -969,35 +951,26 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - [[package]] name = "matchers" 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 = "matchit" -version = "0.5.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memoffset" @@ -1019,9 +992,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -1031,18 +1004,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -1060,16 +1024,15 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", "pin-utils", - "static_assertions", ] [[package]] @@ -1086,9 +1049,9 @@ dependencies = [ [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -1112,7 +1075,7 @@ checksum = "be7d33be719c6f4d09e64e27c1ef4e73485dc4cc1f4d22201f89860a7fe22e22" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] @@ -1124,23 +1087,33 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", +] + +[[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-traits" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", @@ -1157,9 +1130,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.2" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "ordered-stream" @@ -1172,10 +1145,10 @@ dependencies = [ ] [[package]] -name = "os_str_bytes" -version = "6.2.0" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" @@ -1185,28 +1158,28 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] @@ -1221,11 +1194,22 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "polling" -version = "3.3.2" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" dependencies = [ "cfg-if", "concurrent-queue", @@ -1237,59 +1221,34 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.103", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -1297,32 +1256,31 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "bytes", "prost", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1350,31 +1308,23 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" -version = "1.6.0" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.5", + "regex-syntax 0.8.2", ] [[package]] @@ -1383,23 +1333,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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc-demangle" @@ -1409,9 +1367,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -1420,37 +1378,43 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "serde" -version = "1.0.140" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -1459,20 +1423,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.9" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -1481,18 +1445,18 @@ 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-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -1506,16 +1470,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "socket2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -1534,15 +1488,15 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -1551,9 +1505,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.22" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1562,59 +1516,29 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", - "fastrand 1.8.0", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.103", + "fastrand", + "rustix", + "windows-sys 0.52.0", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] @@ -1631,7 +1555,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -1655,14 +1579,14 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.48", ] [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -1671,9 +1595,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1684,21 +1608,28 @@ dependencies = [ ] [[package]] -name = "toml" -version = "0.5.9" +name = "toml_datetime" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "serde", + "indexmap 2.2.2", + "toml_datetime", + "winnow", ] [[package]] name = "tonic" -version = "0.8.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b9af819e54b8f33d453655bef9b9acc171568fb49523078d0cc4e7484200ec" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ - "async-stream", "async-trait", "axum", "base64", @@ -1713,15 +1644,12 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "prost-derive", "tokio", "tokio-stream", - "tokio-util", "tower", "tower-layer", "tower-service", "tracing", - "tracing-futures", ] [[package]] @@ -1732,7 +1660,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand", @@ -1744,25 +1672,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" -dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.2" @@ -1777,12 +1686,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", - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1790,43 +1697,33 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.48", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-subscriber" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", @@ -1837,15 +1734,15 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uds_windows" @@ -1860,9 +1757,15 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "valuable" @@ -1876,19 +1779,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -1914,15 +1810,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1935,7 +1822,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -1949,17 +1836,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "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]] @@ -1979,9 +1866,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" @@ -1991,9 +1878,9 @@ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -2003,9 +1890,9 @@ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -2015,9 +1902,9 @@ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -2027,9 +1914,9 @@ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -2039,9 +1926,9 @@ checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" @@ -2051,9 +1938,9 @@ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" @@ -2061,13 +1948,22 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winnow" +version = "0.5.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +dependencies = [ + "memchr", +] + [[package]] name = "xdg-home" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" dependencies = [ - "nix 0.26.2", + "libc", "winapi", ] @@ -2113,7 +2009,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 1.0.103", + "syn 1.0.109", "zvariant_utils", ] @@ -2147,7 +2043,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", "zvariant_utils", ] @@ -2158,5 +2054,5 @@ source = "git+https://github.com/dbus2/zbus/#7e60915b2ac11fc2e2b3a5cdb821e835305 dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn 1.0.109", ] From c1ae907bfbe28ad3612c2e990366497a414ebd1a Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sun, 11 Feb 2024 00:23:31 +0100 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20some=20unused=20import?= =?UTF-8?q?s=20for=20non-unix=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/fdo.rs | 2 ++ tests/greet.rs | 5 ++++- tests/multiple_conns.rs | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/fdo.rs b/tests/fdo.rs index 534b03b..0c0d2f0 100644 --- a/tests/fdo.rs +++ b/tests/fdo.rs @@ -1,9 +1,11 @@ +#[cfg(unix)] use std::env::temp_dir; use anyhow::ensure; use busd::bus::Bus; use futures_util::stream::StreamExt; use ntest::timeout; +#[cfg(unix)] use rand::{ distributions::{Alphanumeric, DistString}, thread_rng, diff --git a/tests/greet.rs b/tests/greet.rs index 52c4ab1..0cf4974 100644 --- a/tests/greet.rs +++ b/tests/greet.rs @@ -1,9 +1,12 @@ -use std::{env::temp_dir, time::Duration}; +#[cfg(unix)] +use std::env::temp_dir; +use std::time::Duration; use anyhow::anyhow; use busd::bus::Bus; use futures_util::{pin_mut, stream::StreamExt}; use ntest::timeout; +#[cfg(unix)] use rand::{ distributions::{Alphanumeric, DistString}, thread_rng, diff --git a/tests/multiple_conns.rs b/tests/multiple_conns.rs index a6759a5..dba6d5e 100644 --- a/tests/multiple_conns.rs +++ b/tests/multiple_conns.rs @@ -1,8 +1,10 @@ +#[cfg(unix)] use std::env::temp_dir; use busd::bus::Bus; use futures_util::future::join_all; use ntest::timeout; +#[cfg(unix)] use rand::{ distributions::{Alphanumeric, DistString}, thread_rng, From bb19bacb7bf1579d7b036a5dd90baeb456a532ec Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sun, 11 Feb 2024 00:25:48 +0100 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=91=B7=20CI:=20Fatal=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 289b1ac..4bba0cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: env: RUST_LOG: "trace" RUST_BACKTRACE: "full" + RUSTFLAGS: -D warnings runs-on: ${{ matrix.os }} strategy: matrix: From 9a0f46710acb5ff6335e112967bca401993ffe94 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sun, 11 Feb 2024 00:28:09 +0100 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=9A=A8=20tests:=20Fix=20clippy=20warn?= =?UTF-8?q?ings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/fdo.rs | 2 +- tests/greet.rs | 2 +- tests/monitor.rs | 9 ++++----- tests/multiple_conns.rs | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/fdo.rs b/tests/fdo.rs index 0c0d2f0..c10ce42 100644 --- a/tests/fdo.rs +++ b/tests/fdo.rs @@ -34,7 +34,7 @@ async fn name_ownership_changes() { } // TCP socket - let address = format!("tcp:host=127.0.0.1,port=4242"); + let address = "tcp:host=127.0.0.1,port=4242".to_string(); name_ownership_changes_(&address, AuthMechanism::Cookie).await; name_ownership_changes_(&address, AuthMechanism::Anonymous).await; } diff --git a/tests/greet.rs b/tests/greet.rs index 0cf4974..1c7bb2a 100644 --- a/tests/greet.rs +++ b/tests/greet.rs @@ -37,7 +37,7 @@ async fn greet() { } // TCP socket - let address = format!("tcp:host=127.0.0.1,port=4248"); + let address = "tcp:host=127.0.0.1,port=4248".to_string(); greet_(&address, AuthMechanism::Cookie).await; greet_(&address, AuthMechanism::Anonymous).await; } diff --git a/tests/monitor.rs b/tests/monitor.rs index 45f9ad0..1b824a8 100644 --- a/tests/monitor.rs +++ b/tests/monitor.rs @@ -16,7 +16,7 @@ use zbus::{ async fn become_monitor() { busd::tracing_subscriber::init(); - let address = format!("tcp:host=127.0.0.1,port=4242"); + let address = "tcp:host=127.0.0.1,port=4242".to_string(); let mut bus = Bus::for_address(Some(&address), AuthMechanism::Anonymous) .await .unwrap(); @@ -57,10 +57,9 @@ async fn become_monitor_client(address: &str, tx: Sender<()>) -> anyhow::Result< // Signals for the monitor loosing its unique name. let signal = loop { let msg = msg_stream.try_next().await?.unwrap(); - match NameOwnerChanged::from_message(msg) { - Some(signal) => break signal, - // Ignore other messages (e.g `BecomeMonitor` method & reply) - None => (), + // Ignore other messages (e.g `BecomeMonitor` method & reply) + if let Some(signal) = NameOwnerChanged::from_message(msg) { + break signal; } }; let args = signal.args()?; diff --git a/tests/multiple_conns.rs b/tests/multiple_conns.rs index dba6d5e..9aba4ef 100644 --- a/tests/multiple_conns.rs +++ b/tests/multiple_conns.rs @@ -28,7 +28,7 @@ async fn multi_conenct() { } // TCP socket - let address = format!("tcp:host=127.0.0.1,port=4246"); + let address = "tcp:host=127.0.0.1,port=4246".to_string(); multi_conenct_(&address, AuthMechanism::Cookie).await; multi_conenct_(&address, AuthMechanism::Anonymous).await; } From ece49d965d7389544fafcd8721807a5e6520bc42 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sun, 11 Feb 2024 00:34:34 +0100 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=91=B7=20CI:=20Tell=20clippy=20to=20a?= =?UTF-8?q?lso=20lint=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bba0cb..9f9e9e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,4 +65,4 @@ jobs: components: clippy - uses: Swatinem/rust-cache@v2 - name: Check common mistakes - run: cargo clippy --all -- -D warnings + run: cargo clippy --tests --all -- -D warnings