diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..c73ff17 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1744 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] +name = "anyhow" +version = "1.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "clap" +version = "4.5.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "crates_io_api" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200ad30d24892baf2168f2df366939264d02f2fa0be0914f8e2da4bd3407c58c" +dependencies = [ + "chrono", + "futures", + "reqwest", + "serde", + "serde_derive", + "serde_json", + "serde_path_to_error", + "tokio", + "url", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "find-msvc-tools" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.177" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "mio" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "releases" +version = "0.1.0" +dependencies = [ + "anyhow", + "clap", + "crates_io_api", + "semver", + "serde", + "serde_json", + "tokio", + "toml", +] + +[[package]] +name = "reqwest" +version = "0.12.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rust-bitcoin-maintainer-tools" +version = "0.1.0" +dependencies = [ + "clap", + "serde", + "serde_json", + "toml", + "xshell", +] + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustls" +version = "0.23.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", + "serde_core", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "xshell" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e7290c623014758632efe00737145b6867b66292c42167f2ec381eb566a373d" +dependencies = [ + "xshell-macros", +] + +[[package]] +name = "xshell-macros" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ac00cd3f8ec9c1d33fb3e7958a82df6989c42d747bd326c822b1d625283547" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..ffc1f8d --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "releases", + "tasks", +] +resolver = "2" diff --git a/releases/Cargo.toml b/releases/Cargo.toml index 9fdf054..d82d652 100644 --- a/releases/Cargo.toml +++ b/releases/Cargo.toml @@ -18,5 +18,5 @@ crates_io_api = { version = "0.11.0", default-features = false, features = ["rus semver = { version = "1.0.22", default-features = false, features = ["std"] } serde_json = { version = "1.0.116", default-features = false, features = [] } serde = { version = "1.0.198", features = ["derive"] } -tokio = { version = "1.37.0", features = ["rt", "macros"] } +tokio = { version = "1.37.0", features = ["rt-multi-thread", "macros"] } toml = { version = "0.8.12", default-features = false, features = ["display", "parse"] } diff --git a/tasks/CHANGELOG.md b/tasks/CHANGELOG.md new file mode 100644 index 0000000..f70fe25 --- /dev/null +++ b/tasks/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## [0.1.0] - + +* Initial release of `rust-bitcoin-maintainer-tools` (executable: `rbmt`) matching functionality of shell scripts. diff --git a/tasks/Cargo.toml b/tasks/Cargo.toml new file mode 100644 index 0000000..739447d --- /dev/null +++ b/tasks/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "rust-bitcoin-maintainer-tools" +version = "0.1.0" +authors = ["Nick Johnson "] +license = "CC0-1.0" +edition = "2021" +rust-version = "1.74.0" + +[[bin]] +name = "rbmt" +path = "src/main.rs" + +[dependencies] +xshell = "0.2" +clap = { version = "4", features = ["derive"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +toml = "0.8" diff --git a/tasks/README.md b/tasks/README.md new file mode 100644 index 0000000..72fdbd4 --- /dev/null +++ b/tasks/README.md @@ -0,0 +1,134 @@ +# Maintainer Tools + +Maintainer tools for Rust-based projects in the Bitcoin domain. Built with [xshell](https://github.com/matklad/xshell). + +## Configuration + +Configuration for `rbmt` is stored in `contrib/rbmt.toml`. The file can live at both the workspace root (e.g. `$ROOT/contrib/rbmt.toml`) as well as per-crate (e.g. `$ROOT/$CRATE/contrib/rbmt.toml`) within a repository. + +### Lint + +The `lint` command detects duplicate dependencies, but some may be unavoidable (e.g., during dependency updates where transitive dependencies haven't caught up). Configure the `[lint]` section to whitelist specific duplicates for a workspace (or a crate if only one crate in a repository). + +```toml +[lint] +allowed_duplicates = [ + "syn", + "bitcoin_hashes", +] +``` + +### Test + +The `test` command can be configured to run feature matrix testing for your crate. Configure with the `contrib/rbmt.toml` file at the crate level. + +```toml +[test] +# Examples to run with specific features enabled. +# Format: "example_name:feature1 feature2" +examples = [ + "example1:serde", + "example2:serde rand", +] + +# Features to test with the conventional `std` feature enabled. +# Tests each feature alone with std, all pairs, and all together. +# Example: ["serde", "rand"] tests: std+serde, std+rand, std+serde+rand +features_with_std = ["serde", "rand"] + +# Features to test without the `std` feature. +# Tests each feature alone, all pairs, and all together. +# Example: ["serde", "rand"] tests: serde, rand, serde+rand +features_without_std = ["serde", "rand"] + +# Exact feature combinations to test. +# Use for crates that don't follow conventional `std` patterns. +# Each inner array is tested as-is with no automatic combinations. +# Example: [["serde", "rand"], ["rand"]] tests exactly those two combinations +exact_features = [ + ["serde", "rand"], + ["rand"], +] + +# Features to test with an explicit `no-std` feature enabled. +# Only use if your crate has a `no-std` feature (rust-miniscript pattern). +# Tests each feature with no-std, all pairs, and all together. +# Example: ["serde", "rand"] tests: no-std+serde, no-std+rand, no-std+serde+rand +features_with_no_std = ["serde", "rand"] +``` + +### Environment Variables + +* `RBMT_LOG_LEVEL=quiet` - Suppress verbose output and reduce cargo noise. + +## Lock Files + +To ensure your crate works with the full range of declared dependency versions, `rbmt` requires two lock files in your repository. + +* `Cargo-minimal.lock` - Minimum versions that satisfy your dependency constraints. +* `Cargo-recent.lock` - Recent/updated versions of dependencies. + +The `rbmt lock` command generates and maintains these files for you. You can then use `--lock-file` with any command to test against either version set. + +### Usage + +**Generate/update lock files** + +```bash +rbmt lock +``` + +1. Verify that direct dependency versions aren't being bumped by transitive dependencies. +2. Generate `Cargo-minimal.lock` with minimal versions across the entire dependency tree. +3. Update `Cargo-recent.lock` with conservatively updated dependencies. + +**Use a specific lock file** + +```bash +# Test with minimal versions. +rbmt --lock-file minimal test stable + +# Test with recent versions. +rbmt --lock-file recent test stable + +# Works with any command. +rbmt --lock-file minimal lint +rbmt --lock-file minimal docs +``` + +When you specify `--lock-file`, the tool copies that lock file to `Cargo.lock` before running the command. This allows you to test your code against different dependency version constraints. + +## Workspace Integration + +`rbmt` can simply be installed globally, or as a dev-dependency for more granular control of dependency versions. + +### 1. Install globally + +Install the tool globally on your system with `cargo install`. + +```bash +cargo install rust-bitcoin-maintainer-tools@0.1.0 +``` + +Then run from anywhere in your repository. + +```bash +rbmt lint +``` + +### 2. Add as a dev-dependency + +Add as a dev-dependency to a workspace member. This pins the tool version in your lockfile for reproducible builds. + +```toml +[dev-dependencies] +rust-bitcoin-maintainer-tools = "0.1.0" +``` + +Then run via cargo. + +```bash +cargo run --bin rbmt -- lint +``` + +It might be worth wrapping in an [xtask](https://github.com/matklad/cargo-xtask) package for a clean interface. diff --git a/tasks/justfile b/tasks/justfile new file mode 100644 index 0000000..580860c --- /dev/null +++ b/tasks/justfile @@ -0,0 +1,11 @@ +# List available recipes. +_default: + @just --list + +# Run tests. +test: + cargo test + +# Install rbmt from the local path. +install: + cargo install --path . diff --git a/tasks/src/bench.rs b/tasks/src/bench.rs new file mode 100644 index 0000000..31f15c1 --- /dev/null +++ b/tasks/src/bench.rs @@ -0,0 +1,31 @@ +//! Benchmark testing tasks. + +use crate::environment::{get_crate_dirs, quiet_println}; +use crate::quiet_cmd; +use crate::toolchain::{check_toolchain, Toolchain}; +use xshell::Shell; + +/// Run benchmark tests for all crates in the workspace. +pub fn run(sh: &Shell, packages: &[String]) -> Result<(), Box> { + check_toolchain(sh, Toolchain::Nightly)?; + + let crate_dirs = get_crate_dirs(sh, packages)?; + + quiet_println(&format!( + "Running bench tests for {} crates", + crate_dirs.len() + )); + + for crate_dir in &crate_dirs { + quiet_println(&format!("Running bench tests in: {}", crate_dir)); + + // Use pushd pattern to change and restore directory. + let _dir = sh.push_dir(crate_dir); + + quiet_cmd!(sh, "cargo bench") + .env("RUSTFLAGS", "--cfg=bench") + .run()?; + } + + Ok(()) +} diff --git a/tasks/src/docs.rs b/tasks/src/docs.rs new file mode 100644 index 0000000..83be63c --- /dev/null +++ b/tasks/src/docs.rs @@ -0,0 +1,47 @@ +//! Documentation building tasks. + +use crate::quiet_cmd; +use crate::toolchain::{check_toolchain, Toolchain}; +use xshell::Shell; + +/// Build documentation for end users with the stable toolchain. +/// +/// This verifies that `cargo doc` works correctly for users with stable Rust. +/// Uses basic rustdoc warnings to catch common documentation issues. +pub fn run(sh: &Shell, packages: &[String]) -> Result<(), Box> { + check_toolchain(sh, Toolchain::Stable)?; + + let mut cmd = quiet_cmd!(sh, "cargo doc --all-features"); + + // Add package filters if specified. + for package in packages { + cmd = cmd.args(&["-p", package]); + } + + cmd.env("RUSTDOCFLAGS", "-D warnings").run()?; + + Ok(()) +} + +/// Build documentation for docs.rs with the nightly toolchain. +/// +/// This emulates the docs.rs build environment by using the nightly toolchain +/// with `--cfg docsrs` enabled. This catches docs.rs-specific issues. +pub fn run_docsrs(sh: &Shell, packages: &[String]) -> Result<(), Box> { + check_toolchain(sh, Toolchain::Nightly)?; + + let mut cmd = quiet_cmd!(sh, "cargo doc --all-features"); + + // Add package filters if specified. + for package in packages { + cmd = cmd.args(&["-p", package]); + } + + cmd.env( + "RUSTDOCFLAGS", + "--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links", + ) + .run()?; + + Ok(()) +} diff --git a/tasks/src/environment.rs b/tasks/src/environment.rs new file mode 100644 index 0000000..1eb467c --- /dev/null +++ b/tasks/src/environment.rs @@ -0,0 +1,93 @@ +use std::env; +use xshell::{cmd, Shell}; + +/// Environment variable to control output verbosity. +/// Set to "quiet" to suppress informational messages and reduce cargo output. +/// Any other value (or unset) defaults to verbose mode. +const LOG_LEVEL_ENV_VAR: &str = "RBMT_LOG_LEVEL"; + +/// Path to the RBMT configuration file relative to workspace/crate root. +pub const CONFIG_FILE_PATH: &str = "contrib/rbmt.toml"; + +/// Check if we're in quiet mode via environment variable. +pub fn is_quiet_mode() -> bool { + env::var(LOG_LEVEL_ENV_VAR).is_ok_and(|v| v == "quiet") +} + +/// Helper macro to create commands that respect quiet mode. +#[macro_export] +macro_rules! quiet_cmd { + ($sh:expr, $($arg:tt)*) => {{ + let mut cmd = xshell::cmd!($sh, $($arg)*); + if $crate::environment::is_quiet_mode() { + cmd = cmd.quiet(); + } + cmd + }}; +} + +/// Print a message unless in quiet mode. +pub fn quiet_println(msg: &str) { + if !is_quiet_mode() { + println!("{}", msg); + } +} + +/// Configure shell log level and output verbosity. +/// Sets cargo output verbosity based on LOG_LEVEL_ENV_VAR. +pub fn configure_log_level(sh: &Shell) { + if is_quiet_mode() { + sh.set_var("CARGO_TERM_VERBOSE", "false"); + sh.set_var("CARGO_TERM_QUIET", "true"); + } else { + sh.set_var("CARGO_TERM_VERBOSE", "true"); + sh.set_var("CARGO_TERM_QUIET", "false"); + } +} + +/// Change to the repository root directory. +/// +/// # Panics +/// +/// Panics if not in a git repository or git command fails. +pub fn change_to_repo_root(sh: &Shell) { + let repo_dir = cmd!(sh, "git rev-parse --show-toplevel") + .read() + .expect("Failed to get repository root, ensure you're in a git repository"); + sh.change_dir(&repo_dir); +} + +/// Get list of crate directories in the workspace using cargo metadata. +/// Returns fully qualified paths to support various workspace layouts including nested crates. +/// +/// # Arguments +/// +/// * `packages` - Optional filter for specific package names. If empty, returns all packages. +pub fn get_crate_dirs(sh: &Shell, packages: &[String]) -> Result, Box> { + let metadata = cmd!(sh, "cargo metadata --no-deps --format-version 1").read()?; + let json: serde_json::Value = serde_json::from_str(&metadata)?; + + let crate_dirs: Vec = json["packages"] + .as_array() + .ok_or("Missing 'packages' field in cargo metadata")? + .iter() + .filter_map(|package| { + let manifest_path = package["manifest_path"].as_str()?; + // Extract directory path from the manifest path, + // e.g., "/path/to/repo/releases/Cargo.toml" -> "/path/to/repo/releases". + let dir_path = manifest_path.trim_end_matches("/Cargo.toml"); + + // Filter by package name if specified. + if !packages.is_empty() { + let package_name = package["name"].as_str()?; + if !packages.contains(&package_name.to_string()) { + return None; + } + } + + Some(dir_path.to_string()) + }) + .collect(); + + Ok(crate_dirs) +} diff --git a/tasks/src/lint.rs b/tasks/src/lint.rs new file mode 100644 index 0000000..04b94be --- /dev/null +++ b/tasks/src/lint.rs @@ -0,0 +1,139 @@ +use std::fs; +use xshell::Shell; + +use crate::environment::{get_crate_dirs, quiet_println, CONFIG_FILE_PATH}; +use crate::quiet_cmd; +use crate::toolchain::{check_toolchain, Toolchain}; + +/// Lint configuration loaded from contrib/rbmt.toml. +#[derive(Debug, serde::Deserialize)] +struct Config { + lint: LintConfig, +} + +/// Lint-specific configuration. +#[derive(Debug, serde::Deserialize)] +struct LintConfig { + /// List of crate names that are allowed to have duplicate versions. + allowed_duplicates: Vec, +} + +impl LintConfig { + /// Load lint configuration from the workspace root. + fn load(sh: &Shell) -> Result> { + let config_path = sh.current_dir().join(CONFIG_FILE_PATH); + + if !config_path.exists() { + // Return empty config if file doesn't exist. + return Ok(LintConfig { + allowed_duplicates: Vec::new(), + }); + } + + let contents = fs::read_to_string(&config_path)?; + let config: Config = toml::from_str(&contents)?; + Ok(config.lint) + } +} + +/// Run the lint task. +pub fn run(sh: &Shell, packages: &[String]) -> Result<(), Box> { + check_toolchain(sh, Toolchain::Nightly)?; + quiet_println("Running lint task..."); + + lint_workspace(sh)?; + lint_crates(sh, packages)?; + check_duplicate_deps(sh)?; + + quiet_println("Lint task completed successfully"); + Ok(()) +} + +/// Lint the workspace with clippy. +fn lint_workspace(sh: &Shell) -> Result<(), Box> { + quiet_println("Linting workspace..."); + + // Run clippy on workspace with all features. + quiet_cmd!( + sh, + "cargo clippy --workspace --all-targets --all-features --keep-going" + ) + .args(&["--", "-D", "warnings"]) + .run()?; + + // Run clippy on workspace without features. + quiet_cmd!(sh, "cargo clippy --workspace --all-targets --keep-going") + .args(&["--", "-D", "warnings"]) + .run()?; + + Ok(()) +} + +/// Run extra crate-specific lints. +/// +/// # Why run at the crate level? +/// +/// When running `cargo clippy --workspace --no-default-features`, cargo resolves +/// features across the entire workspace, which can enable features through dependencies +/// even when a crate's own default features are disabled. Running clippy on each crate +/// individually ensures that each crate truly compiles and passes lints with only its +/// explicitly enabled features. +fn lint_crates(sh: &Shell, packages: &[String]) -> Result<(), Box> { + quiet_println("Running crate-specific lints..."); + + let crate_dirs = get_crate_dirs(sh, packages)?; + quiet_println(&format!("Found crates: {}", crate_dirs.join(", "))); + + for crate_dir in crate_dirs { + // Returns a RAII guard which reverts the working directory to the old value when dropped. + let _old_dir = sh.push_dir(&crate_dir); + + // Run clippy without default features. + quiet_cmd!( + sh, + "cargo clippy --all-targets --no-default-features --keep-going" + ) + .args(&["--", "-D", "warnings"]) + .run()?; + } + + Ok(()) +} + +/// Check for duplicate dependencies. +fn check_duplicate_deps(sh: &Shell) -> Result<(), Box> { + quiet_println("Checking for duplicate dependencies..."); + + let config = LintConfig::load(sh)?; + let allowed_duplicates = &config.allowed_duplicates; + + // Run cargo tree to find duplicates. + let output = quiet_cmd!(sh, "cargo tree --target=all --all-features --duplicates") + .ignore_status() + .read()?; + + let duplicates: Vec<&str> = output + .lines() + // Filter out non crate names. + .filter(|line| line.chars().next().is_some_and(|c| c.is_alphanumeric())) + // Filter out whitelisted crates. + .filter(|line| { + !allowed_duplicates + .iter() + .any(|allowed| line.contains(allowed)) + }) + .collect(); + + if !duplicates.is_empty() { + // Show full tree for context. + quiet_cmd!(sh, "cargo tree --target=all --all-features --duplicates").run()?; + eprintln!("Error: Found duplicate dependencies in workspace!"); + for dup in &duplicates { + eprintln!(" {}", dup); + } + return Err("Dependency tree contains duplicates".into()); + } + + quiet_println("No duplicate dependencies found"); + Ok(()) +} diff --git a/tasks/src/lock.rs b/tasks/src/lock.rs new file mode 100644 index 0000000..94669f8 --- /dev/null +++ b/tasks/src/lock.rs @@ -0,0 +1,113 @@ +//! Manage cargo lock files for minimal and recent dependency versions. + +use crate::environment::quiet_println; +use crate::quiet_cmd; +use crate::toolchain::{check_toolchain, Toolchain}; +use clap::ValueEnum; +use std::fs; +use xshell::Shell; + +/// The standard Cargo lockfile name. +const CARGO_LOCK: &str = "Cargo.lock"; + +/// Represents the different types of managed lock files. +#[derive(Debug, Clone, Copy, ValueEnum)] +pub enum LockFile { + /// Uses minimal versions that satisfy dependency constraints. + Minimal, + /// Uses recent/updated versions of dependencies. + Recent, +} + +impl Default for LockFile { + fn default() -> Self { + LockFile::Recent + } +} + +impl LockFile { + /// Get the filename for this lock file type. + pub fn filename(&self) -> &'static str { + match self { + LockFile::Minimal => "Cargo-minimal.lock", + LockFile::Recent => "Cargo-recent.lock", + } + } +} + +/// Update Cargo-minimal.lock and Cargo-recent.lock files. +/// +/// * `Cargo-minimal.lock` - Uses minimal versions that satisfy dependency constraints. +/// * `Cargo-recent.lock` - Uses recent/updated versions of dependencies. +/// +/// The minimal versions strategy uses a combination of `-Z direct-minimal-versions` +/// and `-Z minimal-versions` to ensure two rules. +/// +/// 1. Direct dependency versions in manifests are accurate (not bumped by transitive deps). +/// 2. The entire dependency tree uses minimal versions that still satisfy constraints. +/// +/// This helps catch cases where you've specified a minimum version that's too high, +/// or where your code relies on features from newer versions than declared. +pub fn run(sh: &Shell) -> Result<(), Box> { + check_toolchain(sh, Toolchain::Nightly)?; + + let repo_dir = sh.current_dir(); + quiet_println(&format!("Updating lock files in: {}", repo_dir.display())); + + // The `direct-minimal-versions` and `minimal-versions` dependency resolution strategy + // flags each have a little quirk. `direct-minimal-versions` allows transitive versions + // to upgrade, so we are not testing against the actual minimum tree. `minimal-versions` + // allows the direct dependency versions to resolve upward due to transitive requirements, + // so we are not testing the manifest's versions. Combo'd together though, we can get the + // best of both worlds to ensure the actual minimum dependencies listed in the crate + // manifests build. + + // Check that all explicit direct dependency versions are not lying, + // as in, they are not being bumped up by transitive dependency constraints. + quiet_println("Checking direct minimal versions..."); + remove_lock_file(sh)?; + quiet_cmd!(sh, "cargo check --all-features -Z direct-minimal-versions").run()?; + + // Now that our own direct dependency versions can be trusted, check + // against the lowest versions of the dependency tree which still + // satisfy constraints. Use this as the minimal version lock file. + quiet_println("Generating Cargo-minimal.lock..."); + remove_lock_file(sh)?; + quiet_cmd!(sh, "cargo check --all-features -Z minimal-versions").run()?; + copy_lock_file(sh, LockFile::Minimal)?; + + // Conservatively bump of recent dependencies. + quiet_println("Updating Cargo-recent.lock..."); + restore_lock_file(sh, LockFile::Recent)?; + quiet_cmd!(sh, "cargo check --all-features").run()?; + copy_lock_file(sh, LockFile::Recent)?; + + quiet_println("Lock files updated successfully"); + + Ok(()) +} + +/// Remove Cargo.lock file if it exists. +fn remove_lock_file(sh: &Shell) -> Result<(), Box> { + let lock_path = sh.current_dir().join(CARGO_LOCK); + if lock_path.exists() { + fs::remove_file(&lock_path)?; + } + Ok(()) +} + +/// Copy Cargo.lock to a specific lock file. +fn copy_lock_file(sh: &Shell, target: LockFile) -> Result<(), Box> { + let source = sh.current_dir().join(CARGO_LOCK); + let dest = sh.current_dir().join(target.filename()); + fs::copy(&source, &dest)?; + Ok(()) +} + +/// Restore a specific lock file to Cargo.lock. +pub fn restore_lock_file(sh: &Shell, source: LockFile) -> Result<(), Box> { + let src_path = sh.current_dir().join(source.filename()); + let dest_path = sh.current_dir().join(CARGO_LOCK); + fs::copy(&src_path, &dest_path)?; + Ok(()) +} diff --git a/tasks/src/main.rs b/tasks/src/main.rs new file mode 100644 index 0000000..bc8f5a7 --- /dev/null +++ b/tasks/src/main.rs @@ -0,0 +1,107 @@ +mod bench; +mod docs; +mod environment; +mod lint; +mod lock; +mod test; +mod toolchain; + +use clap::{Parser, Subcommand}; +use std::process; +use xshell::Shell; + +use environment::{change_to_repo_root, configure_log_level}; +use lock::LockFile; +use toolchain::Toolchain; + +#[derive(Parser)] +#[command(name = "rbmt")] +#[command(about = "Rust Bitcoin Maintainer Tools", long_about = None)] +struct Cli { + /// Lock file to use for dependencies (defaults to recent). + #[arg(long, global = true, value_enum)] + lock_file: Option, + + /// Filter to specific package (can be specified multiple times). + #[arg(short = 'p', long = "package", global = true)] + packages: Vec, + + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + /// Run the linter (clippy) for workspace and all crates. + Lint, + /// Build documentation with stable toolchain. + Docs, + /// Build documentation with nightly toolchain for docs.rs. + Docsrs, + /// Run benchmark tests for all crates. + Bench, + /// Run tests with specified toolchain. + Test { + /// Toolchain to use: stable, nightly, or msrv. + #[arg(value_enum)] + toolchain: Toolchain, + }, + /// Update Cargo-minimal.lock and Cargo-recent.lock files. + Lock, +} + +fn main() { + let cli = Cli::parse(); + let sh = Shell::new().unwrap(); + configure_log_level(&sh); + change_to_repo_root(&sh); + + // Restore the specified lock file before running any command (except Lock itself). + if let Some(lock_file) = cli.lock_file { + if !matches!(cli.command, Commands::Lock) { + if let Err(e) = lock::restore_lock_file(&sh, lock_file) { + eprintln!("Error restoring lock file: {}", e); + process::exit(1); + } + } + } + + match cli.command { + Commands::Lint => { + if let Err(e) = lint::run(&sh, &cli.packages) { + eprintln!("Error running lint task: {}", e); + process::exit(1); + } + } + Commands::Docs => { + if let Err(e) = docs::run(&sh, &cli.packages) { + eprintln!("Error building docs: {}", e); + process::exit(1); + } + } + Commands::Docsrs => { + if let Err(e) = docs::run_docsrs(&sh, &cli.packages) { + eprintln!("Error building docs.rs docs: {}", e); + process::exit(1); + } + } + Commands::Bench => { + if let Err(e) = bench::run(&sh, &cli.packages) { + eprintln!("Error running bench tests: {}", e); + process::exit(1); + } + } + Commands::Test { toolchain } => { + if let Err(e) = test::run(&sh, toolchain, &cli.packages) { + eprintln!("Error running tests: {}", e); + process::exit(1); + } + } + Commands::Lock => { + if let Err(e) = lock::run(&sh) { + eprintln!("Error updating lock files: {}", e); + process::exit(1); + } + } + } +} diff --git a/tasks/src/test.rs b/tasks/src/test.rs new file mode 100644 index 0000000..f69c757 --- /dev/null +++ b/tasks/src/test.rs @@ -0,0 +1,260 @@ +//! Build and test tasks with feature matrix testing. + +use crate::environment::{get_crate_dirs, quiet_println, CONFIG_FILE_PATH}; +use crate::quiet_cmd; +use crate::toolchain::{check_toolchain, Toolchain}; +use serde::Deserialize; +use std::path::Path; +use xshell::Shell; + +/// Test configuration loaded from contrib/rbmt.toml. +#[derive(Debug, Deserialize)] +struct Config { + test: TestConfig, +} + +/// Test-specific configuration. +#[derive(Debug, Deserialize)] +struct TestConfig { + /// Examples to run with the format "name:feature1 feature2". + /// + /// # Examples + /// + /// `["example1:serde", "example2:serde rand"]` + examples: Vec, + + /// List of individual features to test with the conventional `std` feature enabled. + /// Automatically tests feature combinations, alone with `std`, all pairs, and all together. + /// + /// # Examples + /// + /// `["serde", "rand"]` tests `std+serde`, `std+rand`, `std+serde+rand`. + features_with_std: Vec, + + /// List of individual features to test without the `std` feature. + /// Automatically tests features combinations, each feature alone, + /// all pairs, and all together. + /// + /// # Examples + /// + /// `["serde", "rand"]` tests `serde`, `rand`, `serde+rand`. + features_without_std: Vec, + + /// Exact feature combinations to test. + /// Use for crates that don't follow the conventional `std` feature pattern. + /// Each inner vector is a list of features to test together. There is + /// no automatic combinations of features tests. + /// + /// # Examples + /// + /// `[["serde", "rand"], ["rand"]]` tests exactly those two combinations. + exact_features: Vec>, + + /// List of individual features to test with the `no-std` feature enabled. + /// Only use if your crate has an explicit `no-std` feature (rust-miniscript pattern). + /// Automatically tests each feature alone with `no-std`, all pairs, and all together. + /// + /// # Examples + /// + /// `["serde", "rand"]` tests `no-std+serde`, `no-std+serde`, `no-std+serde+rand`. + features_with_no_std: Vec, +} + +impl TestConfig { + /// Load test configuration from a crate directory. + fn load(crate_dir: &Path) -> Result> { + let config_path = crate_dir.join(CONFIG_FILE_PATH); + + if !config_path.exists() { + // Return empty config if file doesn't exist. + return Ok(TestConfig { + examples: Vec::new(), + features_with_std: Vec::new(), + features_without_std: Vec::new(), + exact_features: Vec::new(), + features_with_no_std: Vec::new(), + }); + } + + let contents = std::fs::read_to_string(&config_path)?; + let config: Config = toml::from_str(&contents)?; + Ok(config.test) + } +} + +/// Run build and test for all crates with the specified toolchain. +pub fn run(sh: &Shell, toolchain: Toolchain, packages: &[String]) -> Result<(), Box> { + check_toolchain(sh, toolchain)?; + + let crate_dirs = get_crate_dirs(sh, packages)?; + quiet_println(&format!("Testing {} crates", crate_dirs.len())); + + for crate_dir in &crate_dirs { + quiet_println(&format!("Testing crate: {}", crate_dir)); + + let _dir = sh.push_dir(crate_dir); + let config = TestConfig::load(Path::new(crate_dir))?; + + do_test(sh, &config)?; + do_feature_matrix(sh, &config)?; + } + + Ok(()) +} + +/// Run basic build, test, and examples. +fn do_test(sh: &Shell, config: &TestConfig) -> Result<(), Box> { + quiet_println("Running basic tests"); + + // Basic build and test. + quiet_cmd!(sh, "cargo build").run()?; + quiet_cmd!(sh, "cargo test").run()?; + + // Run examples. + for example in &config.examples { + let parts: Vec<&str> = example.split(':').collect(); + if parts.len() != 2 { + return Err(format!( + "Invalid example format: {}, expected 'name:features'", + example + ) + .into()); + } + + let name = parts[0]; + let features = parts[1]; + + quiet_println(&format!( + "Running example {} with features: {}", + name, features + )); + quiet_cmd!(sh, "cargo run --example {name} --features={features}").run()?; + } + + Ok(()) +} + +/// Run feature matrix tests. +fn do_feature_matrix(sh: &Shell, config: &TestConfig) -> Result<(), Box> { + quiet_println("Running feature matrix tests"); + + // Handle exact features (for unusual crates). + if !config.exact_features.is_empty() { + for features in &config.exact_features { + let features_str = features.join(" "); + quiet_println(&format!("Testing exact features: {}", features_str)); + quiet_cmd!( + sh, + "cargo build --no-default-features --features={features_str}" + ) + .run()?; + quiet_cmd!( + sh, + "cargo test --no-default-features --features={features_str}" + ) + .run()?; + } + return Ok(()); + } + + // Handle no-std pattern (rust-miniscript). + if !config.features_with_no_std.is_empty() { + quiet_println("Testing no-std"); + quiet_cmd!(sh, "cargo build --no-default-features --features=no-std").run()?; + quiet_cmd!(sh, "cargo test --no-default-features --features=no-std").run()?; + + loop_features(sh, "no-std", &config.features_with_no_std)?; + } else { + quiet_println("Testing no-default-features"); + quiet_cmd!(sh, "cargo build --no-default-features").run()?; + quiet_cmd!(sh, "cargo test --no-default-features").run()?; + } + + // Test all features. + quiet_println("Testing all-features"); + quiet_cmd!(sh, "cargo build --all-features").run()?; + quiet_cmd!(sh, "cargo test --all-features").run()?; + + // Test features with std. + if !config.features_with_std.is_empty() { + loop_features(sh, "std", &config.features_with_std)?; + } + + // Test features without std. + if !config.features_without_std.is_empty() { + loop_features(sh, "", &config.features_without_std)?; + } + + Ok(()) +} + +/// Test each feature individually and all combinations of two features. +/// +/// This implements three feature matrix testing strategies. +/// 1. All features together. +/// 2. Each feature individually (only if more than one feature). +/// 3. All unique pairs of features. +/// +/// The pair testing catches feature interaction bugs (where two features work +/// independently, but conflict when combined) while keeping test time manageable. +fn loop_features( + sh: &Shell, + base: &str, + features: &[String], +) -> Result<(), Box> { + let base_flag = if base.is_empty() { + String::new() + } else { + format!("{} ", base) + }; + + // Test all features together. + let all_features = format!("{}{}", base_flag, features.join(" ")); + quiet_println(&format!("Testing features: {}", all_features.trim())); + quiet_cmd!( + sh, + "cargo build --no-default-features --features={all_features}" + ) + .run()?; + quiet_cmd!( + sh, + "cargo test --no-default-features --features={all_features}" + ) + .run()?; + + // Test each feature individually and all pairs (only if more than one feature). + if features.len() > 1 { + for i in 0..features.len() { + let feature_combo = format!("{}{}", base_flag, features[i]); + quiet_println(&format!("Testing features: {}", feature_combo.trim())); + quiet_cmd!( + sh, + "cargo build --no-default-features --features={feature_combo}" + ) + .run()?; + quiet_cmd!( + sh, + "cargo test --no-default-features --features={feature_combo}" + ) + .run()?; + + // Test all pairs with features[i]. + for j in (i + 1)..features.len() { + let feature_combo = format!("{}{} {}", base_flag, features[i], features[j]); + quiet_println(&format!("Testing features: {}", feature_combo.trim())); + quiet_cmd!( + sh, + "cargo build --no-default-features --features={feature_combo}" + ) + .run()?; + quiet_cmd!( + sh, + "cargo test --no-default-features --features={feature_combo}" + ) + .run()?; + } + } + } + + Ok(()) +} diff --git a/tasks/src/toolchain.rs b/tasks/src/toolchain.rs new file mode 100644 index 0000000..808352d --- /dev/null +++ b/tasks/src/toolchain.rs @@ -0,0 +1,132 @@ +use std::path::Path; +use xshell::{cmd, Shell}; + +/// Toolchain requirement for a task. +#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)] +pub enum Toolchain { + /// Nightly toolchain. + Nightly, + /// Stable toolchain. + Stable, + /// Minimum Supported Rust Version. + Msrv, +} + +/// Check if the current toolchain matches the requirement of current crate. +/// +/// # Errors +/// +/// * Cannot determine current toolchain version. +/// * Current toolchain doesn't match requirement. +/// * For MSRV: cannot read rust-version from Cargo.toml. +pub fn check_toolchain(sh: &Shell, required: Toolchain) -> Result<(), Box> { + let current = cmd!(sh, "rustc --version").read()?; + + match required { + Toolchain::Nightly => { + if !current.contains("nightly") { + return Err(format!("Need a nightly compiler; have {}", current).into()); + } + } + Toolchain::Stable => { + if current.contains("nightly") || current.contains("beta") { + return Err(format!("Need a stable compiler; have {}", current).into()); + } + } + Toolchain::Msrv => { + let manifest_path = sh.current_dir().join("Cargo.toml"); + + if !manifest_path.exists() { + return Err("Not in a crate directory (no Cargo.toml found)".into()); + } + + let msrv_version = get_msrv_from_manifest(&manifest_path)?; + let current_version = + extract_version(¤t).ok_or("Could not parse rustc version")?; + + if current_version != msrv_version { + return Err(format!( + "Need Rust {} for MSRV testing in {}; have {}", + msrv_version, + manifest_path.display(), + current_version + ) + .into()); + } + } + } + + Ok(()) +} + +/// Extract MSRV from Cargo.toml using cargo metadata. +fn get_msrv_from_manifest(manifest_path: &Path) -> Result> { + let sh = Shell::new()?; + let metadata = cmd!(sh, "cargo metadata --format-version 1 --no-deps").read()?; + let data: serde_json::Value = serde_json::from_str(&metadata)?; + + // Convert Path to string for comparison. If path contains invalid UTF-8, fail early. + let manifest_path_str = manifest_path.to_str().ok_or_else(|| { + format!( + "Manifest path contains invalid UTF-8: {}", + manifest_path.display() + ) + })?; + + let msrv = data["packages"] + .as_array() + .and_then(|packages| { + packages + .iter() + .find(|pkg| pkg["manifest_path"].as_str() == Some(manifest_path_str)) + }) + .and_then(|pkg| pkg["rust_version"].as_str()) + .ok_or_else(|| { + format!( + "No MSRV (rust-version) specified in {}", + manifest_path.display() + ) + })?; + + Ok(msrv.to_string()) +} + +/// Extract version number from rustc --version output. +/// +/// # Examples +/// +/// `"rustc 1.74.0 (79e9716c9 2023-11-13)"` -> `Some("1.74.0")` +fn extract_version(rustc_version: &str) -> Option<&str> { + rustc_version.split_whitespace().find_map(|part| { + // Split off any suffix like "-nightly" or "-beta". + let version_part = part.split('-').next()?; + + // Version format: digit.digit.digit + let parts: Vec<&str> = version_part.split('.').collect(); + if parts.len() == 3 && parts.iter().all(|p| p.chars().all(|c| c.is_ascii_digit())) { + Some(version_part) + } else { + None + } + }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_extract_version() { + assert_eq!( + extract_version("rustc 1.74.0 (79e9716c9 2023-11-13)"), + Some("1.74.0") + ); + assert_eq!( + extract_version("rustc 1.75.0-nightly (12345abcd 2023-11-20)"), + Some("1.75.0") + ); + assert_eq!(extract_version("rustc 1.74.0"), Some("1.74.0")); + assert_eq!(extract_version("rustc unknown version"), None); + assert_eq!(extract_version("no version here"), None); + } +}